summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkki Seppälä <erkki.seppala@vincit.fi>2011-01-31 14:02:03 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-01 23:46:00 -0800
commit7110ac653349a23c80c365f11f6270dc27c8975a (patch)
tree2c23e7f33487744e67f0687a399091dbf8b36a05
parentd695f5da9f5b778e54b6987d9177048e32818c4d (diff)
ImUtil: Handle a memory leak in one early return branch
Fixed memory leak by adding Xfree for image Variable "image" goes out of scope Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/ImUtil.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ImUtil.c b/src/ImUtil.c
index cd418d88..3164d43b 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;