broadband-modem: fix a potential leak in cusd_process_string() error handling

On error, *converted may already be allocated and we need to free it
(but not in case we're returning it from the task).
This commit is contained in:
Lubomir Rintel
2024-05-31 10:46:30 +00:00
committed by Aleksander Morgado
parent 39a90fc39a
commit 5f6b095360
+2 -1
View File
@@ -6617,9 +6617,10 @@ out:
if (error)
g_task_return_error (task, error);
else if (converted)
g_task_return_pointer (task, converted, g_free);
g_task_return_pointer (task, g_steal_pointer (&converted), g_free);
else
g_assert_not_reached ();
g_clear_pointer (&converted, g_free);
return;
}