aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorErkki Seppälä <erkki.seppala@vincit.fi>2011-01-31 14:02:03 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:24 +0200
commit1ac1b691d24af84db4061ca7b3fffb0f588e8f3c (patch)
treec5b522c35a1f298dcec297c064fc2da9ac43ccc1 /nx-X11/lib
parent52d2c35580bd29d27ce8b8712a94be1042cabdda (diff)
downloadnx-libs-1ac1b691d24af84db4061ca7b3fffb0f588e8f3c.tar.gz
nx-libs-1ac1b691d24af84db4061ca7b3fffb0f588e8f3c.tar.bz2
nx-libs-1ac1b691d24af84db4061ca7b3fffb0f588e8f3c.zip
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> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/ImUtil.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/ImUtil.c b/nx-X11/lib/X11/ImUtil.c
index 00b6f7db8..d562e3ae0 100644
--- a/nx-X11/lib/X11/ImUtil.c
+++ b/nx-X11/lib/X11/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;