mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Stop memory leak when returning from png_handle_eXIf() with an error
(Bug report from the OSS-fuzz project).
This commit is contained in:
6
pngset.c
6
pngset.c
@@ -146,7 +146,11 @@ png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_EXIF, 0);
|
||||
if (info_ptr->exif)
|
||||
{
|
||||
png_free(png_ptr, info_ptr->exif);
|
||||
info_ptr->exif = NULL;
|
||||
}
|
||||
|
||||
info_ptr->num_exif = num_exif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user