nmtst: fix memory leak in nmtst_create_minimal_connection()
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-glib-compat.h"
|
#include "nm-glib-compat.h"
|
||||||
|
#include "gsystem-local-alloc.h"
|
||||||
|
|
||||||
|
|
||||||
struct __nmtst_internal
|
struct __nmtst_internal
|
||||||
@@ -687,13 +688,14 @@ nmtst_create_minimal_connection (const char *id, const char *uuid, const char *t
|
|||||||
NMConnection *con;
|
NMConnection *con;
|
||||||
NMSetting *s_base = NULL;
|
NMSetting *s_base = NULL;
|
||||||
NMSettingConnection *s_con;
|
NMSettingConnection *s_con;
|
||||||
|
gs_free char *uuid_free = NULL;
|
||||||
|
|
||||||
g_assert (id);
|
g_assert (id);
|
||||||
|
|
||||||
if (uuid)
|
if (uuid)
|
||||||
g_assert (nm_utils_is_uuid (uuid));
|
g_assert (nm_utils_is_uuid (uuid));
|
||||||
else
|
else
|
||||||
uuid = nm_utils_uuid_generate ();
|
uuid = uuid_free = nm_utils_uuid_generate ();
|
||||||
|
|
||||||
if (type) {
|
if (type) {
|
||||||
GType type_g = nm_connection_lookup_setting_type (type);
|
GType type_g = nm_connection_lookup_setting_type (type);
|
||||||
|
Reference in New Issue
Block a user