shared-qmi: fix memory leak in set_supl_server command

ctx->supl is allocated in mm_shared_qmi_location_set_supl_server
using g_strdup. g_strdup requires to free string when unneeded.

The problem could be reproduced using following commands
```
 while true; do
       mmcli -m any --location-set-supl-server="supl.google.com:7276";
       mem=$(cat /proc/$(pgrep ModemManager)/statm | awk '{print $6}')
       echo $(date +"%s"), $mem | tee -a mm-leak.log;
 done;
```
This commit is contained in:
Andrey Skvortsov
2023-06-23 23:19:53 +03:00
parent 2ea67ae3e8
commit 5eb3acee0a
+1
View File
@@ -4464,6 +4464,7 @@ set_supl_server_context_free (SetSuplServerContext *ctx)
g_signal_handler_disconnect (ctx->client, ctx->indication_id);
g_object_unref (ctx->client);
}
g_free (ctx->supl);
g_slice_free (SetSuplServerContext, ctx);
}