From 8f5a56474671bf3dd4909aa73fec1062fb5a14d8 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Mon, 31 Jan 2011 14:02:08 +0200 Subject: xcms/LRGB: Fix potential resource leak. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit property_return was not free'd if the allocation of pRedTbl failed. Reviewed-by: Erkki Seppälä Signed-off-by: Ander Conselvan de Oliveira Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/LRGB.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/LRGB.c b/nx-X11/lib/X11/LRGB.c index bc1bfd92b..534a7307e 100644 --- a/nx-X11/lib/X11/LRGB.c +++ b/nx-X11/lib/X11/LRGB.c @@ -687,6 +687,7 @@ LINEAR_RGB_InitSCCData( /* Red Intensity Table */ if (!(pScreenData->pRedTbl = (IntensityTbl *) Xcalloc (1, sizeof(IntensityTbl)))) { + XFree ((char * ) property_return); goto FreeSCCData; } if (_XcmsGetTableType0(pScreenData->pRedTbl, format_return, &pChar, @@ -724,6 +725,7 @@ LINEAR_RGB_InitSCCData( /* Red Intensity Table */ if (!(pScreenData->pRedTbl = (IntensityTbl *) Xcalloc (1, sizeof(IntensityTbl)))) { + XFree ((char * ) property_return); goto FreeSCCData; } if (_XcmsGetTableType1(pScreenData->pRedTbl, format_return, &pChar, -- cgit v1.2.3