mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-20 23:30:41 +02:00
initrd: fix memory leak
Signed-off-by: Antonio Cardace <acardace@redhat.com>
Fixes: 9f9609555d ('initrd: add configuration generator')
This commit is contained in:
parent
d619de7727
commit
d5c05d07c7
2 changed files with 9 additions and 1 deletions
|
|
@ -141,6 +141,14 @@ NM_AUTO_DEFINE_FCN0 (GError *, gs_local_free_error, g_error_free);
|
|||
#define gs_unref_keyfile nm_auto(gs_local_keyfile_unref)
|
||||
NM_AUTO_DEFINE_FCN0 (GKeyFile *, gs_local_keyfile_unref, g_key_file_unref);
|
||||
|
||||
/**
|
||||
* gs_free_option_context:
|
||||
*
|
||||
* Call g_option_context_free() on a variable location when it goes out of scope.
|
||||
*/
|
||||
#define gs_free_option_context nm_auto(gs_local_option_context)
|
||||
NM_AUTO_DEFINE_FCN0 (GOptionContext *, gs_local_option_context, g_option_context_free);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "nm-glib.h"
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ main (int argc, char *argv[])
|
|||
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL },
|
||||
{ NULL }
|
||||
};
|
||||
GOptionContext *option_context;
|
||||
gs_free_option_context GOptionContext *option_context = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *hostname = NULL;
|
||||
int errsv;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue