Resolved the Memory Leaks in the code
authorAnuj Jaiswal <anuj.jaiswal@samsung.com>
Mon, 1 Dec 2014 10:50:32 +0000 (16:20 +0530)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Thu, 18 Dec 2014 10:42:00 +0000 (11:42 +0100)
Change-Id: I8d06d8bbfcfde0b160d0d48ecea01dc7ad6e723e
Signed-off-by: Anuj Jaiswal <anuj.jaiswal@samsung.com>
src/common/media-common-utils.c

index 9027f3d..b76a473 100755 (executable)
@@ -102,7 +102,7 @@ static char* __media_get_path(uid_t uid)
                        MS_DBG_ERR("getgrnam(users) returns NULL !");
                        return NULL;
                }
-       }
+    }
        else
        {
                struct passwd *userinfo = getpwuid(uid);
@@ -143,9 +143,10 @@ ms_get_storage_type_by_full(const char *path, uid_t uid)
        } else if (strncmp(path, MEDIA_ROOT_PATH_SDCARD, strlen(MEDIA_ROOT_PATH_SDCARD)) == 0) {
                return MS_STORAGE_EXTERNAL;
        } else
+       { free(user_path);
                return MS_MEDIA_ERR_INVALID_PATH;
+    }
 }
-
 int
 ms_get_mime(const char *path, char *mimetype)
 {