diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-09-08 10:41:33 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-10-11 00:18:05 +0000 |
commit | 3bca0f56fa509c57715ad9f2f1742d73f6ffee6d (patch) | |
tree | 47677d2b4e1b109e82845f2bbd182572a6edcf14 | |
parent | 6cefa3a592ce433a203ddc69e0d5bd1d8a0504fd (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>
(cherry picked from commit 462d13c2f6dc25adea1f19e6b621f97b997236af)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1717>
-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 632971ed9..79765e98b 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -143,6 +143,7 @@ InitPredictableAccelerationScheme(DeviceIntPtr dev, schemeData->vel = vel; scheme.accelData = schemeData; if (!InitializePredictableAccelerationProperties(dev, vel, schemeData)) { + FreeVelocityData(vel); free(vel); free(schemeData); return FALSE; |