Fix memory leak 13/248613/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 1 Dec 2020 01:57:00 +0000 (10:57 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 1 Dec 2020 01:57:00 +0000 (10:57 +0900)
Change-Id: I860a79173237daa9adb357709dda9c0852aebe5b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/modules/extractor/src/amd_extractor.c

index 7a7528f39e48bed69707dd8b073916cd1d8bdb97..c61c1e06a82ca1e2059ba25496c040a7328cb4ce 100644 (file)
@@ -233,6 +233,7 @@ static void __extractor_mount(const amd_appinfo_h ai, bundle *kb,
                                if (new_array[i] == NULL) {
                                        _E("Out of memory");
                                        __free_path(new_array, i);
+                                       __free_path(mnt_path, 2);
                                        return;
                                }
                        }
@@ -240,6 +241,7 @@ static void __extractor_mount(const amd_appinfo_h ai, bundle *kb,
                        if (new_array[len] == NULL) {
                                _E("Out of memory");
                                __free_path(new_array, len);
+                               __free_path(mnt_path, 2);
                                return;
                        }
                        bundle_del(kb, AUL_K_TEP_PATH);
@@ -291,8 +293,10 @@ static void __extractor_unmount(int pid, _extractor_mountable mountable)
        if (mnt_path == NULL)
                return;
 
-       if (!__is_unmountable(appid, mnt_path[0]))
+       if (!__is_unmountable(appid, mnt_path[0])) {
+               __free_path(mnt_path, 2);
                return;
+       }
 
        g_hash_table_remove(mount_point_hash, mnt_path[0]);
        ret = amd_signal_send_tep_unmount(mnt_path[0]);