diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-09-08 10:41:33 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-09-08 11:48:18 -0700 |
commit | 462d13c2f6dc25adea1f19e6b621f97b997236af (patch) | |
tree | 512a02e0c41abaed42f0f6f689534ffa69530a64 | |
parent | 7ee3a520184b355820923bc7a955d0834eb8afbd (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.c | 1 |
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; |