[PATCH v2 16/25] [libx11] property_return was not free'd if the allocation of pRedTbl failed.
Erkki Seppälä
erkki.seppala at vincit.fi
Mon Jan 31 04:02:08 PST 2011
From: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
xcms/LRGB: Fix potential resource leak.
Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
---
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