kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=0f4c0d9453a0c63ffcdde3f9605830b3a13dcf8b

commit 0f4c0d9453a0c63ffcdde3f9605830b3a13dcf8b
Author: Kim Woelders <[email protected]>
Date:   Sat Nov 16 17:55:51 2019 +0100

    image.c: Don't strdup() real_name when not necessary in __imlib_LoadImage()
---
 src/lib/image.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/lib/image.c b/src/lib/image.c
index c09b565..3456d97 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -208,10 +208,11 @@ __imlib_ConsumeImage(ImlibImage * im)
 #endif
 
    __imlib_FreeAllTags(im);
+
+   if (im->real_file && im->real_file != im->file)
+      free(im->real_file);
    if (im->file)
       free(im->file);
-   if (im->real_file)
-      free(im->real_file);
    if (im->key)
       free(im->key);
    if ((IMAGE_FREE_DATA(im)) && (im->data))
@@ -911,7 +912,7 @@ __imlib_LoadImage(const char *file, ImlibProgressFunction 
progress,
 
    if (__imlib_IsRealFile(file))
      {
-        im->real_file = strdup(im->file);
+        im->real_file = im->file;
         im->key = NULL;
      }
    else

-- 


Reply via email to