* Fix memory leak in cases where XMP parsing fails.

This commit is contained in:
Justin Maggard 2010-06-03 21:56:00 +00:00
parent cfe45db393
commit 310f928fab

View File

@ -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);