Coverity Fix :CID 28838 :. leaked_storage: Variable uuid 43/173543/1
authorAvichal Agarwal <avichal.a@samsung.com>
Thu, 22 Mar 2018 07:56:31 +0000 (13:26 +0530)
committerAvichal Agarwal <avichal.a@samsung.com>
Thu, 22 Mar 2018 07:59:45 +0000 (13:29 +0530)
going out of scope leaks the storage it points to

Change-Id: I948df8fae62bf440ac4d50a9a7cfa9cc95bdcec3

src/device.c

index b51d8ed..6dc12a4 100644 (file)
@@ -3973,9 +3973,11 @@ static DBusMessage *set_trusted_profile(DBusConnection *conn,
                else
                        a2dp = SUPPORTED_BLOCKED;
        } else {
+               free(uuid);
                return btd_error_invalid_args(msg);
        }
 
+       free(uuid);
        btd_device_set_trusted_profiles(dev, pbap, map, sap, hfp_hs, a2dp);
        return dbus_message_new_method_return(msg);
 }