Commit 1ac1b691 authored by Erkki Seppälä's avatar Erkki Seppälä Committed by Ulrich Sibiller

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: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: 's avatarAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Signed-off-by: 's avatarErkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 52d2c355
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment