e_utils: fix a memory leak 64/187764/1 accepted/tizen/unified/20180829.142824 submit/tizen/20180828.083306 submit/tizen/20180828.112301
authorSung-Jin Park <sj76.park@samsung.com>
Tue, 28 Aug 2018 07:45:30 +0000 (16:45 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 28 Aug 2018 07:45:30 +0000 (16:45 +0900)
Change-Id: I36abc0e8546a36529f457b5e9a571173c978fb7b
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/e_utils.c

index 120bdbf2385372cb353131b23116cd3149b76ed7..4d86dc9f24fff8049ec27b18050d08be9a376fff 100644 (file)
@@ -1318,9 +1318,10 @@ e_util_file_monitor_add(const char *path, void *data)
    if (eina_hash_find(_e_file_monitor_hash, path))
      return 1;
 
-   dir_path = strdup(path);
    if (!ecore_file_is_dir(path))
      dir_path = ecore_file_dir_get(path);
+   else
+     dir_path = strdup(path);
 
    if (!ecore_file_exists(dir_path))
      {