From 7fa64a8b710539a74c6cf70dd8a7ae6158b33a13 Mon Sep 17 00:00:00 2001 From: t123yh Date: Sat, 21 Oct 2023 15:42:23 -0700 Subject: [PATCH] example: fix invalid free() operation in bluez-session obj->handle should not be directly freed; instead, it should be freed using "pw_unload_spa_handle", otherwise there will be segmentation fault. --- src/examples/bluez-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/bluez-session.c b/src/examples/bluez-session.c index fffe2f4ad..888f6f656 100644 --- a/src/examples/bluez-session.c +++ b/src/examples/bluez-session.c @@ -267,7 +267,7 @@ static void remove_object(struct impl *impl, struct object *obj) spa_list_remove(&obj->link); spa_hook_remove(&obj->listener); pw_proxy_destroy(obj->proxy); - free(obj->handle); + pw_unload_spa_handle(obj->handle); free(obj); }