From 3bca0f56fa509c57715ad9f2f1742d73f6ffee6d 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 (cherry picked from commit 462d13c2f6dc25adea1f19e6b621f97b997236af) Part-of: --- dix/ptrveloc.c | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3