[PATCH 21/32] [libx11] xcms/LRGB: Fix potential resource leak.

Erkki Seppälä erkki.seppala at vincit.fi
Wed Jan 26 23:54:04 PST 2011


From: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>

property_return was not free'd if the allocation of pRedTbl failed.

Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
---
 src/xcms/LRGB.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/xcms/LRGB.c b/src/xcms/LRGB.c
index d9168bd..c1606be 100644
--- a/src/xcms/LRGB.c
+++ b/src/xcms/LRGB.c
@@ -686,6 +686,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,
@@ -723,6 +724,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,
-- 
1.7.0.4



More information about the xorg-devel mailing list