Remove resource leak 08/199608/1 accepted/tizen/unified/20190214.060737 submit/tizen/20190214.011711
authorpr.jung <pr.jung@samsung.com>
Wed, 13 Feb 2019 07:43:57 +0000 (16:43 +0900)
committerpr.jung <pr.jung@samsung.com>
Wed, 13 Feb 2019 07:43:57 +0000 (16:43 +0900)
Change-Id: If9959d9b79061f9c0042a57174a95bdff2898c37
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/storage-inhouse.c

index 5a9ca1f..2ec6f08 100755 (executable)
@@ -266,6 +266,10 @@ API int storage_request_mount_mmc(struct mmc_contents *mmc_data)
        ret = storage_get_primary_sdcard(&id, &path);
        if (ret != STORAGE_ERROR_NONE)
                return ret;
+//LCOV_EXCL_START System Error
+       if (path)
+               free(path);
+//LCOV_EXCL_STOP
 
        ret = dbus_method_async_with_reply_var(STORAGE_EXT_BUS_NAME,
                        STORAGE_EXT_PATH_MANAGER,
@@ -331,6 +335,10 @@ API int storage_request_unmount_mmc(struct mmc_contents *mmc_data, int option)
        ret = storage_get_primary_sdcard(&id, &path);
        if (ret != STORAGE_ERROR_NONE)
                return ret;
+//LCOV_EXCL_START System Error
+       if (path)
+               free(path);
+//LCOV_EXCL_STOP
 
        ret = dbus_method_async_with_reply_var(STORAGE_EXT_BUS_NAME,
                        STORAGE_EXT_PATH_MANAGER,
@@ -401,6 +409,10 @@ API int storage_format_mmc(struct mmc_contents *mmc_data, int option)
        ret = storage_get_primary_sdcard(&id, &path);
        if (ret != STORAGE_ERROR_NONE)
                return ret;
+//LCOV_EXCL_START System Error
+       if (path)
+               free(path);
+//LCOV_EXCL_STOP
 
        ret = dbus_method_async_with_reply_var(STORAGE_EXT_BUS_NAME,
                        STORAGE_EXT_PATH_MANAGER,