Fix memory deference issue 10/206210/3 accepted/tizen/unified/20190515.224831 submit/tizen/20190515.090642
authorwn.jang <wn.jang@samsung.com>
Wed, 15 May 2019 06:35:09 +0000 (15:35 +0900)
committerwn.jang <wn.jang@samsung.com>
Wed, 15 May 2019 08:48:47 +0000 (17:48 +0900)
Change-Id: Ied7439593b1d4c8e104f80af43b0045ba515be67

common/vc_cmd_db.c

index 0fee6eb..a395550 100644 (file)
@@ -862,6 +862,9 @@ static int __vc_db_get_result(sqlite3* db_handle, char** result_text, int* event
                                __vc_db_extract_unfixed_command(*result_text, temp_fixed, &temp_unfixed);
                                vc_cmd_set_command(temp_cmd, temp_fixed);
                                vc_cmd_set_unfixed_command(temp_cmd, temp_unfixed);
+                               if (temp_unfixed)
+                                       free(temp_unfixed);
+                               temp_unfixed = NULL;
                        } else {
                                vc_cmd_set_command(temp_cmd, temp_command);
                        }
@@ -1761,7 +1764,6 @@ static int __vc_db_insert_command(sqlite3* db_handle, int pid, vc_cmd_type_e typ
                        g_slist_free(cmd_list);
                        SLOG(LOG_ERROR, vc_db_tag(), "[ERROR] Fail to insert command, %d", ret);
 
-                       vc_cmd_destroy((vc_cmd_h)tmp_cmd);
                        return ret;
                }
                cmd_list = NULL;