Bluetooth: Fix memory leak when removing a UUID
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 8 Nov 2012 09:25:26 +0000 (10:25 +0100)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Fri, 9 Nov 2012 15:45:37 +0000 (16:45 +0100)
When removing a UUID from the list in the remove_uuid() function we must
also kfree the entry in addition to removing it from the list.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c

index 2cfabe27d3e0f88f01a7081247d2b91875336b11..91de4239da6621d6e5b7a2989beb5bd5b883ff8c 100644 (file)
@@ -1367,6 +1367,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
                        continue;
 
                list_del(&match->list);
+               kfree(match);
                found++;
        }