mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 18:00:10 +01:00
deamon-helper: ensure helper_complete() never returns NULL on success
The in_buffer is initialized with a NULL buffer. If we never receive and data, the buffer might still be NULL. Maybe it actually can never happen, but it's not clear that this is always the case. To be sure, ensure we don't return a NULL buffer on success.
This commit is contained in:
parent
9f6ecbae69
commit
47283b7c76
1 changed files with 3 additions and 1 deletions
|
|
@ -5096,7 +5096,9 @@ helper_complete(HelperInfo *info, GError *error)
|
|||
}
|
||||
|
||||
nm_clear_g_cancellable_disconnect(g_task_get_cancellable(info->task), &info->cancellable_id);
|
||||
g_task_return_pointer(info->task, nm_str_buf_finalize(&info->in_buffer, NULL), g_free);
|
||||
g_task_return_pointer(info->task,
|
||||
nm_str_buf_finalize(&info->in_buffer, NULL) ?: g_new0(char, 1),
|
||||
g_free);
|
||||
helper_info_free(info);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue