mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 00:10:15 +01:00
core/tests: fix memleak in tests to avoid valgrind warnings
(cherry picked from commit 1680bf3ad1)
This commit is contained in:
parent
84ff53ec76
commit
b352d0a26b
1 changed files with 5 additions and 4 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include <nm-simple-connection.h>
|
||||
#include <nm-setting-connection.h>
|
||||
#include "nm-device-ethernet-utils.h"
|
||||
#include "gsystem-local-alloc.h"
|
||||
|
||||
static NMConnection *
|
||||
_new_connection (const char *id)
|
||||
|
|
@ -45,7 +46,7 @@ _new_connection (const char *id)
|
|||
static void
|
||||
test_defname_no_connections (void)
|
||||
{
|
||||
char *name;
|
||||
gs_free char *name;
|
||||
|
||||
name = nm_device_ethernet_utils_get_default_wired_name (NULL);
|
||||
g_assert_cmpstr (name, ==, "Wired connection 1");
|
||||
|
|
@ -57,7 +58,7 @@ static void
|
|||
test_defname_no_conflict (void)
|
||||
{
|
||||
GSList *list = NULL;
|
||||
char *name;
|
||||
gs_free char *name;
|
||||
|
||||
list = g_slist_append (list, _new_connection ("asdfasdfasdfadf"));
|
||||
list = g_slist_append (list, _new_connection ("work wifi"));
|
||||
|
|
@ -75,7 +76,7 @@ static void
|
|||
test_defname_conflict (void)
|
||||
{
|
||||
GSList *list = NULL;
|
||||
char *name;
|
||||
gs_free char *name;
|
||||
|
||||
list = g_slist_append (list, _new_connection ("asdfasdfasdfadf"));
|
||||
list = g_slist_append (list, _new_connection ("Wired connection 1"));
|
||||
|
|
@ -93,7 +94,7 @@ static void
|
|||
test_defname_multiple_conflicts (void)
|
||||
{
|
||||
GSList *list = NULL;
|
||||
char *name;
|
||||
gs_free char *name;
|
||||
|
||||
list = g_slist_append (list, _new_connection ("random gsm connection"));
|
||||
list = g_slist_append (list, _new_connection ("home wifi"));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue