From 462d13c2f6dc25adea1f19e6b621f97b997236af Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Sep 2024 10:41:33 -0700 Subject: dix: InitPredictableAccelerationScheme: avoid memory leak on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clears warning from gcc 14.1: ../dix/ptrveloc.c: In function ‘InitPredictableAccelerationScheme’: ../dix/ptrveloc.c:149:9: warning: leak of ‘’ [CWE-401] [-Wanalyzer-malloc-leak] 149 | free(vel); | ^~~~~~~~~ Signed-off-by: Alan Coopersmith Part-of: --- dix/ptrveloc.c | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3