image: Fix memory leak when cloning images

Was introduced in recent infrastructure changes.
This commit is contained in:
Kim Woelders 2022-08-27 18:21:03 +02:00
parent ecf119af57
commit d30460b39b
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ __imlib_ConsumeImage(ImlibImage * im)
__imlib_FreeAllTags(im);
if (im->fi && im->fi->name && im->fi->name != im->file)
if (im->file && (!im->fi || im->fi->name != im->file))
free(im->file);
free(im->key);
if (im->data && !IM_FLAG_ISSET(im, F_DONT_FREE_DATA))