m-modem-manager: Avoid memory allocations unpacking string types

Signed-off-by: Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>
This commit is contained in:
Evangelos Ribeiro Tzaras 2025-11-25 11:11:54 +01:00 committed by George Kiagiadakis
parent 133b82e61a
commit 9e390f1121

View file

@ -166,7 +166,7 @@ on_voice_signal (GDBusProxy * iface,
g_object_get (wpmm->dbus, "connection", &conn, NULL); g_object_get (wpmm->dbus, "connection", &conn, NULL);
if (!g_strcmp0 (signal, "CallAdded")) { if (!g_strcmp0 (signal, "CallAdded")) {
g_variant_get (params, "(o)", &path); g_variant_get (params, "(&o)", &path);
g_dbus_proxy_new (conn, g_dbus_proxy_new (conn,
G_DBUS_PROXY_FLAGS_NONE, G_DBUS_PROXY_FLAGS_NONE,
NULL, NULL,
@ -176,9 +176,8 @@ on_voice_signal (GDBusProxy * iface,
NULL, NULL,
bind_call, bind_call,
wpmm); wpmm);
g_free (path);
} else if (!g_strcmp0 (signal, "CallDeleted")) { } else if (!g_strcmp0 (signal, "CallDeleted")) {
g_variant_get (params, "(o)", &path); g_variant_get (params, "(&o)", &path);
// The user shouldn't have hundreds of calls, so just linear search. // The user shouldn't have hundreds of calls, so just linear search.
deleted = g_list_find_custom (wpmm->calls, path, match_call_path); deleted = g_list_find_custom (wpmm->calls, path, match_call_path);
@ -186,8 +185,6 @@ on_voice_signal (GDBusProxy * iface,
g_object_unref (deleted->data); g_object_unref (deleted->data);
wpmm->calls = g_list_delete_link (wpmm->calls, deleted); wpmm->calls = g_list_delete_link (wpmm->calls, deleted);
} }
g_free (path);
} }
} }