gui: png_lode: fix freeing of uninitialized pointer
If either calloc or png_uncompress_init fails, free(png) will free the
uninitialized png pointer. Avoid this and while at it postpone the
img allocation till after the early exit.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 3d78b28 commit 1a97b56180112cd64c6c37688cf2060d01c6402d
@Ahmad Fatoum Ahmad Fatoum authored on 22 Aug 2019
Sascha Hauer committed on 30 Aug 2019
Showing 1 changed file
View
lib/gui/png_lode.c