Fix the bug that local variable can't be assigned by sdcard api. 24/126924/2
authorjongmyeongko <jongmyeong.ko@samsung.com>
Mon, 24 Apr 2017 12:16:46 +0000 (21:16 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 25 Apr 2017 09:13:34 +0000 (18:13 +0900)
this can cause the crash issue when there is no sdcard.

Change-Id: Ie7608e6b26e29422eaee2e06c7f7daf54f2673b7
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
(cherry picked from commit 3c9278f9725e42c8097c230101fafff53340bfa7)
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/pkg_getsize.c

index 51c62707b5915f09f5142a7ed053b43dfd63f1cf..6a9e2d737769feae6d0782f2bb6d62a10c1e8fe1 100644 (file)
@@ -84,11 +84,9 @@ static int __get_sdcard_path(char **sdpath)
                return -1;
 
        ret = storage_get_primary_sdcard(&storage_id, sdpath);
-       if (ret != STORAGE_ERROR_NONE) {
-               if (*sdpath)
-                       free(*sdpath);
+       if (ret != STORAGE_ERROR_NONE)
                return -1;
-       }
+
        return 0;
 }