pbap: Fix crash if phone log is empty
authorJaganath Kanakkassery <jaganath.k@samsung.com>
Fri, 22 Mar 2013 10:19:37 +0000 (15:49 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 22 Apr 2013 04:14:16 +0000 (13:14 +0900)
In __bluetooth_pb_get_phone_log_list() if phone log is empty then
contacts_list_first() fails and it frees query. But since caller is
also freeing query double free happens.

Change-Id: If97d2eae0005bab128c0c0ee01697f911f04e41e

pb-agent/bluetooth_pb_agent.c

index 93ad026..d86ae74 100644 (file)
@@ -1278,7 +1278,6 @@ static void __bluetooth_pb_get_vcards(BluetoothPbAgent *agent,
 
        if (status != CONTACTS_ERROR_NONE) {
                contacts_list_destroy(record_list, TRUE);
-               contacts_query_destroy(query);
                return;
        }
 
@@ -1352,7 +1351,6 @@ static void __bluetooth_pb_get_contact_list(BluetoothPbAgent *agent,
 
        if (status != CONTACTS_ERROR_NONE) {
                contacts_list_destroy(record_list, TRUE);
-               contacts_query_destroy(query);
                return;
        }
 
@@ -1421,7 +1419,6 @@ static void __bluetooth_pb_get_phone_log_list(BluetoothPbAgent *agent,
 
        if (status != CONTACTS_ERROR_NONE) {
                contacts_list_destroy(record_list, TRUE);
-               contacts_query_destroy(query);
                return;
        }