[PATCH 14/32] [libx11] Variable "image" goes out of scope

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


Fixed memory leak by adding Xfree

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