cli: free ports only if not NULL
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
This commit is contained in:
+2
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user