Fixed Svace issue 54/74354/1 accepted/tizen_3.0.m2_mobile tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170104.125337 accepted/tizen/3.0/common/20161114.105720 accepted/tizen/3.0/mobile/20161015.033940 accepted/tizen/common/20160614.144225 accepted/tizen/mobile/20160615.001310 accepted/tizen/unified/20170309.032705 submit/tizen/20160614.080602 submit/tizen_3.0.m2/20170104.093750 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_mobile/20161015.000005 submit/tizen_unified/20170308.100406
authorYounho Park <younho.park@samsung.com>
Tue, 14 Jun 2016 04:26:05 +0000 (13:26 +0900)
committerYounho Park <younho.park@samsung.com>
Tue, 14 Jun 2016 04:26:05 +0000 (13:26 +0900)
Change-Id: I4edfae924d31195668cba3937259e232d5d0b3bc
Signed-off-by: Younho Park <younho.park@samsung.com>
storage-plugin/storage-plugin-sample.c

index a052389161b2dedc8ba148105605a3fae1ea2125..48ca0e728d97c33aa1b44d30a41ba356657384e0 100644 (file)
@@ -434,14 +434,16 @@ char *replace_path_str(char *original)
 
        char *temp1 = NULL, *temp2 = NULL;
 
-       while (NULL != (pt = strstr(base, slash))) {
-               temp1 = strndup(base, strlen(base) - strlen(pt));
-               temp2 = strndup(pt + 1, strlen(pt) - 1);
-               free(base);
-               base = g_strconcat(temp1, temp2, NULL);
-               free(temp1);
-               free(temp2);
-               temp1 = temp2 = NULL;
+       if (NULL != base) {
+               while (NULL != (pt = strstr(base, slash))) {
+                       temp1 = strndup(base, strlen(base) - strlen(pt));
+                       temp2 = strndup(pt + 1, strlen(pt) - 1);
+                       free(base);
+                       base = g_strconcat(temp1, temp2, NULL);
+                       free(temp1);
+                       free(temp2);
+                       temp1 = temp2 = NULL;
+               }
        }
 
        return base;