From 1ac1b691d24af84db4061ca7b3fffb0f588e8f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Mon, 31 Jan 2011 14:02:03 +0200 Subject: ImUtil: Handle a memory leak in one early return branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed memory leak by adding Xfree for image Variable "image" goes out of scope Reviewed-by: Alan Coopersmith Reviewed-by: Ander Conselvan de Oliveira Signed-off-by: Erkki Seppälä Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/ImUtil.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nx-X11/lib') 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; -- cgit v1.2.3