Fix improper usage of g_free 90/179390/2
authorNagaraj D R <nagaraj.dr@samsung.com>
Thu, 17 May 2018 12:42:59 +0000 (18:12 +0530)
committerNagaraj D R <nagaraj.dr@samsung.com>
Thu, 17 May 2018 13:51:43 +0000 (13:51 +0000)
g_free should be used for only those memory allocations
done through glib APIs

Change-Id: I5d5275574b0d273594f86786956d86355794db94

client/advertising.c [changed mode: 0755->0644]
src/adapter.c

old mode 100755 (executable)
new mode 100644 (file)
index f0fd359..5ca4599
@@ -576,7 +576,7 @@ void ad_advertise_local_name(DBusConnection *conn, const char *name)
                return;
 
        g_free(ad.local_name);
-       ad.local_name = strdup(name);
+       ad.local_name = g_strdup(name);
 
        g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE, "LocalName");
 }
index ad53afa..a01f33c 100644 (file)
@@ -5886,7 +5886,7 @@ static bool parse_uuids(DBusMessageIter *value, struct discovery_filter *filter)
                bt_uuid_to_uuid128(&uuid, &u128);
                bt_uuid_to_string(&u128, uuidstr, sizeof(uuidstr));
 
-               filter->uuids = g_slist_prepend(filter->uuids, strdup(uuidstr));
+               filter->uuids = g_slist_prepend(filter->uuids, g_strdup(uuidstr));
 
                dbus_message_iter_next(&arriter);
        }