mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-11 02:50:18 +01:00
initrd: fix memory leak
Signed-off-by: Antonio Cardace <acardace@redhat.com> Fixes:9f9609555d('initrd: add configuration generator') (cherry picked from commitd5c05d07c7) (cherry picked from commitbba54613eb) (cherry picked from commit67bb9896b3) (cherry picked from commit5913e4cee9)
This commit is contained in:
parent
12afddbbca
commit
9ed8b871bb
2 changed files with 9 additions and 1 deletions
|
|
@ -231,6 +231,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"
|
||||
|
|
|
|||
|
|
@ -90,7 +90,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;
|
||||
GError *error = NULL;
|
||||
int errsv;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue