Refactoring error handling 37/214737/1
authorINSUN PYO <insun.pyo@samsung.com>
Thu, 26 Sep 2019 02:32:37 +0000 (11:32 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Thu, 26 Sep 2019 02:32:37 +0000 (11:32 +0900)
Change-Id: Ia1d1a2eb9c50c3c1e72f86101e2af5119f744ee0

src/common/storage-helper.c
src/heart/heart-memory.c
src/memory/vmpressure-lowmem-handler.c

index fdea05c..776acfe 100644 (file)
@@ -168,13 +168,11 @@ resourced_ret_c storage_get_size(int type, struct storage_size *size)
                _E("Failed to get internal storage size");
                goto fail;
        }
-       goto success;
 
-fail:
        g_slist_free_full(paths, free);
-       return RESOURCED_ERROR_FAIL;
+       return RESOURCED_ERROR_NONE;
 
-success:
+fail:
        g_slist_free_full(paths, free);
-       return RESOURCED_ERROR_NONE;
+       return RESOURCED_ERROR_FAIL;
 }
index 3b7aae2..893266b 100644 (file)
@@ -106,9 +106,8 @@ static void heart_memory_free_value(gpointer value)
 {
        struct heart_memory_table * table = (struct heart_memory_table *)value;
 
-       if (!table)
-               return;
-       free(table);
+       if (table)
+               free(table);
 }
 
 static int heart_memory_read_length(char *buf, int count)
index 6fa5f71..64b4c75 100644 (file)
@@ -885,7 +885,6 @@ done:
        if (status == LOWMEM_RECLAIM_DONE)
                request_helper_worker(CLEAR_LOGS, MEMPS_LOG_PATH, clear_logs, NULL);
        ctl->status = status;
-       return;
 }
 
 static void *lowmem_reclaim_worker(void *arg)