Diff between c80f88bdff59a2e07f9260121495dc4da7f2357c and ba4289c72e872d52c7fbbc57d6b0b25892b20a1f

Changed Files

File Additions Deletions Status
mesh/pb-adv.c +5 -0 modified

Full Patch

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 291d926..c1316ed 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -560,4 +560,9 @@ void pb_adv_unreg(void *user_data)
 	send_close_ind(session, 0);
 	l_queue_remove(pb_sessions, session);
 	l_free(session);
+
+	if (!l_queue_length(pb_sessions)) {
+		l_queue_destroy(pb_sessions, l_free);
+		pb_sessions = NULL;
+	}
 }