summaryrefslogtreecommitdiff
path: root/obexd/client
diff options
context:
space:
mode:
authorGopal Tiwari <gtiwari@redhat.com>2022-05-31 13:11:15 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-05-31 13:08:57 -0700
commit06d3c7429ad6bdf6eef1bcedee327e74a33c40bf (patch)
tree6995cb7a9366cb86329c01f44be39b78beb12279 /obexd/client
parent39b638526d9a45d54d2d6e3f175fd7eb057ef8f0 (diff)
downloadbluez-06d3c7429ad6bdf6eef1bcedee327e74a33c40bf.tar.gz
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.
Diffstat (limited to 'obexd/client')
-rw-r--r--obexd/client/pbap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 1a2bacc9f..1ed8c68ec 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -925,10 +925,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);