From 3161dc57d4e9b70f852f05e5e474455e121b06ab Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Mon, 31 Jan 2011 14:02:08 +0200 Subject: [PATCH] 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 --- src/xcms/LRGB.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xcms/LRGB.c b/src/xcms/LRGB.c index 2f7a4ccf..77fac367 100644 --- a/src/xcms/LRGB.c +++ b/src/xcms/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,