Cleanup function will be used by next patch --- src/sdp-client.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sdp-client.c b/src/sdp-client.c index edbdaec..b6a3663 100644 --- a/src/sdp-client.c +++ b/src/sdp-client.c @@ -49,15 +49,18 @@ struct cached_sdp_session { static GSList *cached_sdp_sessions = NULL; -static gboolean cached_session_expired(gpointer user_data) +static void cleanup_cached_session(struct cached_sdp_session *cached) { - struct cached_sdp_session *cached = user_data; - cached_sdp_sessions = g_slist_remove(cached_sdp_sessions, cached); - sdp_close(cached->session); - g_free(cached); +} + +static gboolean cached_session_expired(gpointer user_data) +{ + struct cached_sdp_session *cached = user_data; + + cleanup_cached_session(cached); return FALSE; } -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html