[PATCH v2 11/25] [libx11] Fixed memory leak by adding Xfree

Erkki Seppälä erkki.seppala at vincit.fi
Mon Jan 31 04:02:03 PST 2011


Variable "image" goes out of scope

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

diff --git a/src/ImUtil.c b/src/ImUtil.c
index cd418d8..3164d43 100644
--- a/src/ImUtil.c
+++ b/src/ImUtil.c
@@ -372,6 +372,7 @@ XImage *XCreateImage (
 	if (image_bytes_per_line == 0) {
 	    image->bytes_per_line = min_bytes_per_line;
 	} else if (image_bytes_per_line < min_bytes_per_line) {
+	    Xfree(image);
 	    return NULL;
 	} else {
 	    image->bytes_per_line = image_bytes_per_line;
-- 
1.7.0.4



More information about the xorg-devel mailing list