Fix svace issue (168145) 07/122507/1 accepted/tizen/3.0/common/20170403.140220 accepted/tizen/3.0/ivi/20170403.054958 accepted/tizen/3.0/mobile/20170403.054842 accepted/tizen/3.0/tv/20170403.054926 accepted/tizen/3.0/wearable/20170403.054941 submit/tizen_3.0/20170403.000655
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 3 Apr 2017 00:03:04 +0000 (09:03 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 3 Apr 2017 00:03:04 +0000 (09:03 +0900)
Change-Id: I65108912c5672e74c5e913d88052ce3fe0a8d817
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-httpproxy/bt-httpproxy.c

index 471aeb2..b6d640f 100644 (file)
@@ -329,10 +329,9 @@ static void _bt_hps_set_char_value(const char *obj_path, const char* value, int
                                        char_info->char_value = g_try_realloc(char_info->char_value, value_length);
                                }
                                if (char_info->char_value) {
-                                       if (str) {
+                                       if (str)
                                                memcpy(char_info->char_value, str, strlen(str));
-                                               g_free(str);
-                                       }
+
                                        if (offset > 0) {
                                                memcpy(&char_info->char_value[offset], value, value_length);
                                                char_info->value_length = offset + value_length;
@@ -343,6 +342,7 @@ static void _bt_hps_set_char_value(const char *obj_path, const char* value, int
                                        hps_char_list = g_slist_insert_sorted(hps_char_list,
                                                                        char_info, char_info_cmp);
                                }
+                               g_free(str);
                                return;
                        }
                }