From: Haochen Tong Date: Sun, 25 Sep 2022 16:31:39 +0000 (+0800) Subject: tools/mpris-proxy: unregister object path if player registration fails X-Git-Tag: accepted/tizen/unified/20230608.164325~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=336ba30576407a6c452054b963b1a738079cff44;p=platform%2Fupstream%2Fbluez.git tools/mpris-proxy: unregister object path if player registration fails The `owner' string, passed as user data, is freed if the player fails registration, but the object path still exists. Upon program exiting, the lingering path will be enumerated and the attached user data will be freed again. Signed-off-by: Manika Shrivastava Signed-off-by: Ayush Garg --- diff --git a/tools/mpris-proxy.c b/tools/mpris-proxy.c index 9f868e0..5edce43 100755 --- a/tools/mpris-proxy.c +++ b/tools/mpris-proxy.c @@ -479,6 +479,7 @@ static void add_player(DBusConnection *conn, const char *name, reply = dbus_connection_send_with_reply_and_block(sys, msg, -1, &err); if (!reply) { fprintf(stderr, "Can't register player\n"); + dbus_connection_unregister_object_path(sys, path); free(owner); if (dbus_error_is_set(&err)) { fprintf(stderr, "%s\n", err.message);