From: Gopal Tiwari Date: Tue, 31 May 2022 07:41:15 +0000 (+0530) Subject: pbap: Fix memory leak X-Git-Tag: accepted/tizen/unified/20230608.164325~218 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3a5b992995b32f20730a0c17c36b876d7d23b41;p=platform%2Fupstream%2Fbluez.git pbap: Fix memory leak Reported by coverity tool as follows: bluez-5.64/obexd/client/pbap.c:929: leaked_storage: Variable "apparam" going out of scope leaks the storage it points to. Signed-off-by: Manika Shrivastava Signed-off-by: Ayush Garg --- diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c index 3332790..5404f66 100755 --- a/obexd/client/pbap.c +++ b/obexd/client/pbap.c @@ -972,10 +972,11 @@ static DBusMessage *pbap_search(DBusConnection *connection, return g_dbus_create_error(message, ERROR_INTERFACE ".InvalidArguments", NULL); - if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) + if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) { + g_obex_apparam_free(apparam); return g_dbus_create_error(message, ERROR_INTERFACE ".InvalidArguments", NULL); - + } dbus_message_iter_get_basic(&args, &value); dbus_message_iter_next(&args);