1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-13 16:07:36 +00:00

best-match: Fix potential memory leak

We would leak memory if calls_best_match_set_phone_number would be called a
second time with a SIP address.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-01-13 17:19:46 +01:00
parent ebc5e584bb
commit c594726ce5

View file

@ -322,6 +322,7 @@ calls_best_match_set_phone_number (CallsBestMatch *self,
if (g_str_has_prefix (self->phone_number, "sip")) {
g_auto (GStrv) split = g_strsplit_set (self->phone_number, ":@", -1);
g_free (self->name_sip);
self->name_sip = g_strdup (split[1]);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_PHONE_NUMBER]);
return;