Fix bug 60/186660/1
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 13 Aug 2018 08:15:11 +0000 (17:15 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 13 Aug 2018 08:15:11 +0000 (17:15 +0900)
Free GError for the next

Change-Id: I18782179eac6b417d4faaa0d568663cbd4b2903f
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-common-external-storage.c
src/scanner/media-scanner-scan.c

index 579cad7..c0ef4d5 100755 (executable)
@@ -75,6 +75,10 @@ int ms_read_device_info(const char *root_path, char **device_uuid)
                }
        } else {
                MS_DBG_ERR("g_dir_open failed [%s]", root_path);
+               if (error) {
+                       g_error_free(error);
+                       error = NULL;
+               }
                *device_uuid = NULL;
                return MS_MEDIA_ERR_INVALID_PATH;
        }
index a1a6834..3d8838d 100755 (executable)
@@ -812,6 +812,10 @@ static int __msc_dir_scan_meta_update(void **handle, const char*start_path, cons
                        }
                } else {
                        MS_DBG_ERR("%s folder opendir fails", current_path);
+                       if (error) {
+                               g_error_free(error);
+                               error = NULL;
+                       }
                }
 
                if (dir) {