mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 21:20:20 +01:00
shared: add nm_utils_named_value_clear_with_g_free() helper
This commit is contained in:
parent
c4d981959e
commit
571aeec933
2 changed files with 14 additions and 0 deletions
|
|
@ -3066,6 +3066,18 @@ nm_utils_fd_read_loop_exact(int fd, void *buf, size_t nbytes, bool do_poll)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
nm_utils_named_value_clear_with_g_free(NMUtilsNamedValue *val)
|
||||
{
|
||||
if (val) {
|
||||
gs_free gpointer x_name = NULL;
|
||||
gs_free gpointer x_value = NULL;
|
||||
|
||||
x_name = (gpointer) g_steal_pointer(&val->name);
|
||||
x_value = g_steal_pointer(&val->value_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
G_STATIC_ASSERT(G_STRUCT_OFFSET(NMUtilsNamedValue, name) == 0);
|
||||
|
||||
NMUtilsNamedValue *
|
||||
|
|
|
|||
|
|
@ -1460,6 +1460,8 @@ void nm_utils_named_value_list_sort(NMUtilsNamedValue *arr,
|
|||
GCompareDataFunc compare_func,
|
||||
gpointer user_data);
|
||||
|
||||
void nm_utils_named_value_clear_with_g_free(NMUtilsNamedValue *val);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gpointer *nm_utils_hash_keys_to_array(GHashTable * hash,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue