Blame SOURCES/0010-pbap-Fix-memory-leak.patch

67d7dc
From 06d3c7429ad6bdf6eef1bcedee327e74a33c40bf Mon Sep 17 00:00:00 2001
67d7dc
From: Gopal Tiwari <gtiwari@redhat.com>
67d7dc
Date: Tue, 31 May 2022 13:11:15 +0530
67d7dc
Subject: [PATCH BlueZ 10/12] pbap: Fix memory leak
67d7dc
67d7dc
Reported by coverity tool as follows:
67d7dc
67d7dc
bluez-5.64/obexd/client/pbap.c:929: leaked_storage: Variable "apparam"
67d7dc
going out of scope leaks the storage it points to.
67d7dc
---
67d7dc
 obexd/client/pbap.c | 5 +++--
67d7dc
 1 file changed, 3 insertions(+), 2 deletions(-)
67d7dc
67d7dc
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
67d7dc
index 1a2bacc9f..1ed8c68ec 100644
67d7dc
--- a/obexd/client/pbap.c
67d7dc
+++ b/obexd/client/pbap.c
67d7dc
@@ -925,10 +925,11 @@ static DBusMessage *pbap_search(DBusConnection *connection,
67d7dc
 		return g_dbus_create_error(message,
67d7dc
 				ERROR_INTERFACE ".InvalidArguments", NULL);
67d7dc
 
67d7dc
-	if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
67d7dc
+	if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) {
67d7dc
+		g_obex_apparam_free(apparam);
67d7dc
 		return g_dbus_create_error(message,
67d7dc
 				ERROR_INTERFACE ".InvalidArguments", NULL);
67d7dc
-
67d7dc
+	}
67d7dc
 	dbus_message_iter_get_basic(&args, &value);
67d7dc
 	dbus_message_iter_next(&args);
67d7dc
 
67d7dc
-- 
67d7dc
2.26.2
67d7dc