summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-09-08 10:41:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-09-08 11:48:18 -0700
commit462d13c2f6dc25adea1f19e6b621f97b997236af (patch)
tree512a02e0c41abaed42f0f6f689534ffa69530a64
parent7ee3a520184b355820923bc7a955d0834eb8afbd (diff)
dix: InitPredictableAccelerationScheme: avoid memory leak on failure
Clears warning from gcc 14.1: ../dix/ptrveloc.c: In function ‘InitPredictableAccelerationScheme’: ../dix/ptrveloc.c:149:9: warning: leak of ‘<unknown>’ [CWE-401] [-Wanalyzer-malloc-leak] 149 | free(vel); | ^~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
-rw-r--r--dix/ptrveloc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 5166288e8..ee5a24c9e 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -146,6 +146,7 @@ InitPredictableAccelerationScheme(DeviceIntPtr dev,
schemeData->vel = vel;
scheme.accelData = schemeData;
if (!InitializePredictableAccelerationProperties(dev, vel, schemeData)) {
+ FreeVelocityData(vel);
free(vel);
free(schemeData);
return FALSE;