device: Fix invalid memory read during GATT discovery

device->browse should be set to NULL before calling
browse_request_free(), otherwise it points to freed memory.
This commit is contained in:
Anderson Lizardo 2012-02-14 12:06:02 -04:00 committed by Johan Hedberg
parent d2c09255ef
commit 27c076bbc9

View File

@ -2005,6 +2005,7 @@ int device_browse_primary(struct btd_device *device, DBusConnection *conn,
BT_IO_OPT_INVALID);
if (device->att_io == NULL) {
device->browse = NULL;
browse_request_free(req);
g_free(attcb);
return -EIO;