Skip to content

Commit

Permalink
Fix some memory leak (#27800)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamMicSzm authored and pull[bot] committed Dec 11, 2023
1 parent 4c19e03 commit 1747636
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platform/Linux/bluez/Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static BluezLEAdvertisement1 * BluezAdvertisingCreate(BluezEndpoint * apEndpoint
BluezObjectSkeleton * object;
GVariant * serviceData;
GVariant * serviceUUID;
gchar * localName;
gchar * localName = nullptr;
GVariantBuilder serviceDataBuilder;
GVariantBuilder serviceUUIDsBuilder;
char * debugStr;
Expand Down Expand Up @@ -192,6 +192,7 @@ static BluezLEAdvertisement1 * BluezAdvertisingCreate(BluezEndpoint * apEndpoint
BLEManagerImpl::NotifyBLEPeripheralAdvConfiguredComplete(true, nullptr);

exit:
g_free(localName);
return adv;
}

Expand Down Expand Up @@ -814,6 +815,9 @@ static BluezGattCharacteristic1 * BluezCharacteristicCreate(BluezGattService1 *

bluez_object_skeleton_set_gatt_characteristic1(object, characteristic);
g_dbus_object_manager_server_export(aRoot, G_DBUS_OBJECT_SKELETON(object));

g_free(charPath);
g_free(servicePath);
g_object_unref(object);

return characteristic;
Expand Down

0 comments on commit 1747636

Please sign in to comment.