diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 346f6a30..9d3d900a 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -346,7 +346,8 @@ print_modem_info (void) g_free (bands); mm_modem_get_ports (ctx->modem, &ports, &n_ports); ports_string = mm_common_build_ports_string (ports, n_ports); - mm_modem_port_info_array_free (ports, n_ports); + if (ports) + mm_modem_port_info_array_free (ports, n_ports); mm_modem_get_ignored_ports (ctx->modem, &ignored_ports, &n_ignored_ports); ignored_ports_string = mm_common_build_ports_string (ignored_ports, n_ignored_ports); if (ignored_ports)