if ( !info_value->s) {
EXIF_ERRLOG_EALLOC
info_data->length = 0;
- return;
+ break; /* better return with "" instead of possible casing problems */
}
break;
ImageInfo.sections_found |= FOUND_COMPUTED;/* do not inform about in debug*/
- if (ret==FALSE || array_init(return_value) == FAILURE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) {
+ if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found) || array_init(return_value) == FAILURE)) {
+ /* array_init must be checked at last! otherwise the array must be freed if a later test fails. */
exif_discard_imageinfo(&ImageInfo);
if ( sections_str) efree(sections_str);
RETURN_FALSE;