* Fix memory leak in cases where XMP parsing fails.
This commit is contained in:
parent
cfe45db393
commit
310f928fab
@ -345,7 +345,10 @@ image_get_jpeg_date_xmp(const char * path, char ** date)
|
|||||||
ParseNameValue(data, offset, &xml);
|
ParseNameValue(data, offset, &xml);
|
||||||
exif = GetValueFromNameValueList(&xml, "DateTimeOriginal");
|
exif = GetValueFromNameValueList(&xml, "DateTimeOriginal");
|
||||||
if( !exif )
|
if( !exif )
|
||||||
|
{
|
||||||
|
ClearNameValueList(&xml);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
*date = realloc(*date, strlen(exif)+1);
|
*date = realloc(*date, strlen(exif)+1);
|
||||||
strcpy(*date, exif);
|
strcpy(*date, exif);
|
||||||
ClearNameValueList(&xml);
|
ClearNameValueList(&xml);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user