kwo pushed a commit to branch master.

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

commit e415e0364c821aeb25197f569aa2b986ba97e31d
Author: Youssef Rebahi-Gilbert <[email protected]>
Date:   Mon Mar 7 21:26:21 2022 +0100

    fix: possible memleak in rgba save on big endian systems
---
 src/modules/loaders/loader_argb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/loaders/loader_argb.c 
b/src/modules/loaders/loader_argb.c
index 564ce6f..7ffaafb 100644
--- a/src/modules/loaders/loader_argb.c
+++ b/src/modules/loaders/loader_argb.c
@@ -119,14 +119,14 @@ save(ImlibImage * im, ImlibProgressFunction progress, 
char progress_granularity)
    DATA32             *ptr;
    int                 y, alpha = 0;
 
-#ifdef WORDS_BIGENDIAN
-   DATA32             *buf = (DATA32 *) malloc(im->w * 4);
-#endif
-
    f = fopen(im->real_file, "wb");
    if (!f)
       return LOAD_FAIL;
 
+#ifdef WORDS_BIGENDIAN
+   DATA32             *buf = (DATA32 *) malloc(im->w * 4);
+#endif
+
    if (IM_FLAG_ISSET(im, F_HAS_ALPHA))
       alpha = 1;
 

-- 


Reply via email to