OSDN Git Service

Fix memory leak when calling endpoint to select capabilities
authorLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>
Tue, 11 Jan 2011 14:42:27 +0000 (16:42 +0200)
committerJohan Hedberg <johan.hedberg@nokia.com>
Tue, 11 Jan 2011 15:19:09 +0000 (17:19 +0200)
When passing allocated memory to avdtp_service_cap_new it needs to be
freed since avdtp_service_cap_new copies the memory.

audio/a2dp.c

index c5da708..c1d82bb 100644 (file)
@@ -1833,6 +1833,7 @@ static void select_cb(struct media_endpoint *endpoint, void *ret, int size,
                                                sizeof(*cap) + size);
 
        setup->caps = g_slist_append(setup->caps, media_codec);
+       g_free(cap);
 
 done:
        finalize_select(setup);