Fixed SVACE issue 61/244061/1 submit/tizen/20200914.152130
authorAmritanshu <a.pandia1@samsung.com>
Mon, 14 Sep 2020 11:34:40 +0000 (17:04 +0530)
committerAmritanshu <a.pandia1@samsung.com>
Mon, 14 Sep 2020 11:34:40 +0000 (17:04 +0530)
Change-Id: I578319260f840404220ad643df5b57cca45ff6fb
Signed-off-by: Amritanshu <a.pandia1@samsung.com>
src/interaction.c

index b0b41af9ae4f5c7478561c1a3a7cdf0a12d2056a..53d87a8bc563adcaad5b08f47579eb19ba217ad3 100755 (executable)
@@ -71,7 +71,10 @@ static char* fota_get_update_image_version()
        bool flag_image = FALSE;
        char *image_path = NULL, *directory = NULL, *version = NULL, *token = NULL;
        char *cmd = strdup(download_cmd);
-       LOGI("cmd : %s", download_cmd);
+       if(!cmd)
+               return NULL;
+
+       LOGI("cmd : %s", cmd);
 
        while ((token = strsep(&cmd, " "))) {
                if (strstr(token, "delta.tar")) {
@@ -80,8 +83,10 @@ static char* fota_get_update_image_version()
                }
        }
        LOGI("Update image path : %s", image_path);
-       if(!image_path)
+       if(!image_path) {
+               free(cmd);
                return NULL;
+       }
 
        snprintf(path, sizeof(path), "%s", image_path);