Fix the svace issue 36/71036/1 accepted/tizen/common/20160524.150447 accepted/tizen/ivi/20160524.095058 accepted/tizen/mobile/20160524.095007 accepted/tizen/wearable/20160524.095120 submit/tizen/20160524.012152
authorHyuk Lee <hyuk0512.lee@samsung.com>
Tue, 24 May 2016 00:05:30 +0000 (09:05 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Tue, 24 May 2016 00:05:30 +0000 (09:05 +0900)
- WGID:67836(double free)
- WGID:81568, 81570(null after deref)
- WGID:81578(memory leak)

Change-Id: I774d485be0797636cf0f0a4b3801c43e20904793
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
ag-agent/bluetooth-ag-agent.c
map-agent/bluetooth_map_email.c

index 74b80fd..16bd920 100755 (executable)
@@ -2265,7 +2265,6 @@ void _bt_ag_set_headset_state(bt_ag_info_t *hs, hs_state_t state)
                        __bt_ag_stop_sco_server(hs);
 
                g_free(hs->remote_addr);
-               g_free(hs->slc);
                g_free(hs);
                break;
 
index 90a8d65..2ce737e 100644 (file)
@@ -186,13 +186,14 @@ static void __bt_email_subscription_callback(GDBusConnection *connection,
                }
 
                handle = _bt_add_id(mailid, BT_MAP_ID_EMAIL);
-               if (mailbox->mailbox_type == EMAIL_MAILBOX_TYPE_INBOX) {
-                       _bt_mns_client_event_notify("NewMessage", handle,
-                                                               "TELECOM/MSG/INBOX", "",
-                                                               "EMAIL");
-               }
-               if (mailbox)
+               if (mailbox) {
+                       if (mailbox->mailbox_type == EMAIL_MAILBOX_TYPE_INBOX) {
+                               _bt_mns_client_event_notify("NewMessage", handle,
+                                               "TELECOM/MSG/INBOX", "",
+                                               "EMAIL");
+                       }
                        email_free_mailbox(&mailbox, 1);
+               }
 
        } else if (subtype == NOTI_MAIL_MOVE_FINISH) {
                /* Received values from Signal*/
@@ -281,10 +282,9 @@ static void __bt_email_subscription_callback(GDBusConnection *connection,
                                mail_ids = g_list_next(mail_ids);
                        }
                }
-               if (mailbox_to)
-                       email_free_mailbox(&mailbox_to, 1);
-               if (mailbox_from)
-                       email_free_mailbox(&mailbox_from, 1);
+
+               email_free_mailbox(&mailbox_to, 1);
+               email_free_mailbox(&mailbox_from, 1);
        }
 }
 
@@ -463,7 +463,10 @@ static message_info_t *__bt_email_info_get(email_mail_list_item_t *email_struct,
                email_info->recipient_name = g_strdup(mail_data->alias_recipient);
        }
 
-       email_info->recipient_addressing = g_strdup(mail_data->email_address_recipient);
+       if (mail_data->email_address_recipient) {
+               g_free(email_info->recipient_addressing);
+               email_info->recipient_addressing = g_strdup(mail_data->email_address_recipient);
+       }
 
        return email_info;
 }