Skip to content

shared-qmi: fix memory leak in set_supl_server command

Andrey Skvortsov requested to merge skv/ModemManager:fix-set-supl-memleak into main

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;

Merge request reports

Loading