From 4a10493605df4563ad42c29f50eee5c62bc59985 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 20 Oct 2008 23:12:30 +0200 Subject: [PATCH] obexd: Fix SDP record memory leak --- obexd/client/session.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/obexd/client/session.c b/obexd/client/session.c index ed15bf2f2..6c412bda8 100644 --- a/obexd/client/session.c +++ b/obexd/client/session.c @@ -196,7 +196,6 @@ static void search_callback(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *user_data) { struct callback_data *callback = user_data; - sdp_list_t *recs = NULL; int scanned, seqlen = 0, bytesleft = size; uint8_t dataType, channel = 0; @@ -232,6 +231,8 @@ static void search_callback(uint8_t type, uint16_t status, protos = NULL; } + sdp_record_free(rec); + if (ch > 0) { channel = ch; break; @@ -240,8 +241,6 @@ static void search_callback(uint8_t type, uint16_t status, scanned += recsize; rsp += recsize; bytesleft -= recsize; - - recs = sdp_list_append(recs, rec); } while (scanned < size && bytesleft > 0); if (channel == 0) @@ -257,9 +256,6 @@ static void search_callback(uint8_t type, uint16_t status, failed: sdp_close(callback->sdp); - if (recs) - sdp_list_free(recs, (sdp_free_func_t) sdp_record_free); - callback->func(callback->session, callback->data); session_unref(callback->session); g_free(callback); -- 2.47.3