summary refs log tree commit diff
path: root/libnm-util/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util/tests')
-rw-r--r--libnm-util/tests/Makefile.am1
-rw-r--r--libnm-util/tests/Makefile.in32
-rw-r--r--libnm-util/tests/test-crypto.c5
-rw-r--r--libnm-util/tests/test-general.c30
-rw-r--r--libnm-util/tests/test-secrets.c22
-rw-r--r--libnm-util/tests/test-setting-8021x.c3
-rw-r--r--libnm-util/tests/test-setting-dcb.c11
7 files changed, 75 insertions, 29 deletions
diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am
index 690bdbf6..16a7f8f3 100644
--- a/libnm-util/tests/Makefile.am
+++ b/libnm-util/tests/Makefile.am
@@ -10,6 +10,7 @@ AM_CPPFLAGS = \
 	-DBUILD_DIR=\"$(abs_builddir)\" \
 	-DTEST_CERT_DIR=\"$(top_srcdir)/libnm-core/tests/certs/\"
 
+@VALGRIND_RULES@
 TESTS = \
 	test-settings-defaults \
 	test-crypto \
diff --git a/libnm-util/tests/Makefile.in b/libnm-util/tests/Makefile.in
index 9ef02e8c..5ef0d87b 100644
--- a/libnm-util/tests/Makefile.in
+++ b/libnm-util/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -86,8 +96,6 @@ host_triplet = @host@
 @ENABLE_TESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1) \
 @ENABLE_TESTS_TRUE@	test-libnm-linking$(EXEEXT)
 subdir = libnm-util/tests
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/build-aux/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/compiler_warnings.m4 \
@@ -104,6 +112,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -254,6 +263,8 @@ am__tty_colors = { \
     std=''; \
   fi; \
 }
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+	$(top_srcdir)/build-aux/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALL_LINGUAS = @ALL_LINGUAS@
@@ -280,7 +291,6 @@ CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
 DBUS_CFLAGS = @DBUS_CFLAGS@
 DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@
 DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@
@@ -315,6 +325,7 @@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
 GNUTLS_LIBS = @GNUTLS_LIBS@
 GREP = @GREP@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
@@ -599,7 +610,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libnm-util/tests/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu libnm-util/tests/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -674,14 +684,14 @@ distclean-compile:
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -993,6 +1003,10 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
+
+@ENABLE_TESTS_TRUE@@VALGRIND_RULES@
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c
index 4bf2b3be..8055facf 100644
--- a/libnm-util/tests/test-crypto.c
+++ b/libnm-util/tests/test-crypto.c
@@ -96,7 +96,7 @@ out:
 static void
 test_cert (gconstpointer test_data)
 {
-	char *path;
+	gs_free char *path = NULL;
 	GByteArray *array;
 	NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN;
 	GError *error = NULL;
@@ -153,6 +153,7 @@ test_load_private_key (const char *path,
 		        "unexpected failure determining private key file '%s' "
 		        "type with invalid password (expected %d, got %d)",
 		        path, NM_CRYPTO_KEY_TYPE_UNKNOWN, key_type);
+		g_clear_error (&error);
 		return;
 	}
 
@@ -183,6 +184,7 @@ test_load_private_key (const char *path,
 		g_byte_array_free (decrypted, TRUE);
 	}
 
+	g_clear_error (&error);
 	g_byte_array_free (array, TRUE);
 }
 
@@ -207,6 +209,7 @@ test_load_pkcs12 (const char *path,
 			    "%d): %d %s",
 			    path, NM_CRYPTO_FILE_FORMAT_PKCS12, format, error->code, error->message);
 	}
+	g_clear_error (&error);
 }
 
 static void
diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c
index f748fcf5..d8f9dcc4 100644
--- a/libnm-util/tests/test-general.c
+++ b/libnm-util/tests/test-general.c
@@ -30,6 +30,7 @@
 #include <sys/resource.h>
 
 #include <nm-utils.h>
+#include "gsystem-local-alloc.h"
 
 #include "nm-setting-private.h"
 #include "nm-setting-connection.h"
@@ -310,6 +311,13 @@ test_setting_vpn_modify_during_foreach (void)
 	g_object_unref (s_vpn);
 }
 
+static void
+_g_value_array_free (void *ptr)
+{
+	if (ptr)
+		g_value_array_free ((GValueArray *) ptr);
+}
+
 #define OLD_DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID))
 #define OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", OLD_DBUS_TYPE_G_IP6_ADDRESS))
 
@@ -338,7 +346,7 @@ test_setting_ip6_config_old_address_array (void)
 
 	g_value_init (&written_value, OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS);
 
-	addresses = g_ptr_array_new ();
+	addresses = g_ptr_array_new_full (0, _g_value_array_free);
 	array = g_value_array_new (3);
 
 	/* IP address */
@@ -398,6 +406,7 @@ test_setting_ip6_config_old_address_array (void)
 	ASSERT (memcmp (ba->data, &gw[0], sizeof (gw)) == 0,
 	        "ip6-old-addr", "unexpected failure comparing gateways");
 
+	g_ptr_array_unref (addresses);
 	g_value_unset (&written_value);
 	g_value_unset (&read_value);
 	g_object_unref (s_ip6);
@@ -406,7 +415,7 @@ test_setting_ip6_config_old_address_array (void)
 static void
 test_setting_gsm_apn_spaces (void)
 {
-	NMSettingGsm *s_gsm;
+	gs_unref_object NMSettingGsm *s_gsm = NULL;
 	const char *tmp;
 
 	s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
@@ -434,7 +443,7 @@ test_setting_gsm_apn_spaces (void)
 static void
 test_setting_gsm_apn_bad_chars (void)
 {
-	NMSettingGsm *s_gsm;
+	gs_unref_object NMSettingGsm *s_gsm = NULL;
 
 	s_gsm = (NMSettingGsm *) nm_setting_gsm_new ();
 	ASSERT (s_gsm != NULL,
@@ -472,7 +481,7 @@ test_setting_gsm_apn_bad_chars (void)
 static void
 test_setting_gsm_apn_underscore (void)
 {
-	NMSettingGsm *s_gsm;
+	gs_unref_object NMSettingGsm *s_gsm = NULL;
 	GError *error = NULL;
 	gboolean success;
 
@@ -491,7 +500,7 @@ test_setting_gsm_apn_underscore (void)
 static void
 test_setting_gsm_without_number (void)
 {
-	NMSettingGsm *s_gsm;
+	gs_unref_object NMSettingGsm *s_gsm = NULL;
 	GError *error = NULL;
 	gboolean success;
 
@@ -1573,6 +1582,7 @@ test_connection_good_base_types (void)
 	              NM_SETTING_GSM_APN, "metered.billing.sucks",
 	              NULL);
 	nm_connection_add_setting (connection, setting);
+	g_clear_object (&connection);
 
 	/* CDMA connection */
 	connection = nm_connection_new ();
@@ -1671,7 +1681,7 @@ test_connection_bad_base_types (void)
 static void
 test_setting_compare_id (void)
 {
-	NMSetting *old, *new;
+	gs_unref_object NMSetting *old = NULL, *new = NULL;
 	gboolean success;
 
 	old = nm_setting_connection_new ();
@@ -1697,7 +1707,7 @@ test_setting_compare_secrets (NMSettingSecretFlags secret_flags,
                               NMSettingCompareFlags comp_flags,
                               gboolean remove_secret)
 {
-	NMSetting *old, *new;
+	gs_unref_object NMSetting *old = NULL, *new = NULL;
 	gboolean success;
 
 	/* Make sure that a connection with transient/unsaved secrets compares
@@ -1729,7 +1739,7 @@ test_setting_compare_vpn_secrets (NMSettingSecretFlags secret_flags,
                                   NMSettingCompareFlags comp_flags,
                                   gboolean remove_secret)
 {
-	NMSetting *old, *new;
+	gs_unref_object NMSetting *old = NULL, *new = NULL;
 	gboolean success;
 
 	/* Make sure that a connection with transient/unsaved secrets compares
@@ -1908,7 +1918,7 @@ test_setting_connection_changed_signal (void)
 	NMConnection *connection;
 	gboolean changed = FALSE;
 	NMSettingConnection *s_con;
-	char *uuid;
+	gs_free char *uuid = NULL;
 
 	connection = nm_connection_new ();
 	g_signal_connect (connection,
@@ -2318,7 +2328,7 @@ static void
 test_setting_old_uuid (void)
 {
 	GError *error = NULL;
-	NMSetting *setting;
+	gs_unref_object NMSetting *setting = NULL;
 	gboolean success;
 
 	/* NetworkManager-0.9.4.0 generated 40-character UUIDs with no dashes,
diff --git a/libnm-util/tests/test-secrets.c b/libnm-util/tests/test-secrets.c
index fb0ad4c7..a22edb0f 100644
--- a/libnm-util/tests/test-secrets.c
+++ b/libnm-util/tests/test-secrets.c
@@ -176,6 +176,7 @@ test_need_tls_secrets_path (void)
 			"need-tls-secrets-path-key-password",
 			"expected to require private key password, but it wasn't");
 
+	g_ptr_array_free (hints, TRUE);
 	g_object_unref (connection);
 }
 
@@ -219,6 +220,7 @@ test_need_tls_secrets_blob (void)
 			"need-tls-secrets-blob-key-password",
 			"expected to require private key password, but it wasn't");
 
+	g_ptr_array_free (hints, TRUE);
 	g_object_unref (connection);
 }
 
@@ -345,6 +347,7 @@ test_need_tls_phase2_secrets_path (void)
 			"need-tls-phase2-secrets-path-key-password",
 			"expected to require private key password, but it wasn't");
 
+	g_ptr_array_free (hints, TRUE);
 	g_object_unref (connection);
 }
 
@@ -389,6 +392,7 @@ test_need_tls_phase2_secrets_blob (void)
 			"need-tls-phase2-secrets-blob-key-password",
 			"expected to require private key password, but it wasn't");
 
+	g_ptr_array_free (hints, TRUE);
 	g_object_unref (connection);
 }
 
@@ -507,6 +511,7 @@ test_update_secrets_wifi_single_setting (void)
 	tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0);
 	g_assert_cmpstr (tmp, ==, wepkey);
 
+	g_hash_table_unref (secrets);
 	g_object_unref (connection);
 }
 
@@ -547,6 +552,7 @@ test_update_secrets_wifi_full_hash (void)
 	tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0);
 	g_assert_cmpstr (tmp, ==, wepkey);
 
+	g_hash_table_unref (all);
 	g_object_unref (connection);
 }
 
@@ -577,6 +583,8 @@ test_update_secrets_wifi_bad_setting_name (void)
 	g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
 	g_assert (success == FALSE);
 
+	g_clear_error (&error);
+	g_hash_table_unref (secrets);
 	g_object_unref (connection);
 }
 
@@ -600,7 +608,7 @@ test_update_secrets_whole_connection (void)
 	secrets = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
 	wsec_hash = g_hash_table_lookup (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
 	g_assert (wsec_hash);
-	g_hash_table_insert (wsec_hash, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, string_to_gvalue (wepkey));
+	g_hash_table_insert (wsec_hash, g_strdup (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0), string_to_gvalue (wepkey));
 
 	success = nm_connection_update_secrets (connection, NULL, secrets, &error);
 	g_assert_no_error (error);
@@ -610,6 +618,7 @@ test_update_secrets_whole_connection (void)
 	g_assert (s_wsec);
 	g_assert_cmpstr (nm_setting_wireless_security_get_wep_key (s_wsec, 0), ==, wepkey);
 
+	g_hash_table_unref (secrets);
 	g_object_unref (connection);
 }
 
@@ -629,6 +638,7 @@ test_update_secrets_whole_connection_empty_hash (void)
 	g_assert_no_error (error);
 	g_assert (success == TRUE);
 	g_object_unref (connection);
+	g_hash_table_unref (secrets);
 }
 
 static void
@@ -650,20 +660,23 @@ test_update_secrets_whole_connection_bad_setting (void)
 	secrets = nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
 	wsec_hash = g_hash_table_lookup (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
 	g_assert (wsec_hash);
-	g_hash_table_insert (wsec_hash, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, string_to_gvalue (wepkey));
+	g_hash_table_insert (wsec_hash, g_strdup (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0), string_to_gvalue (wepkey));
 
 	/* Steal the wsec setting hash so it's not deallocated, and stuff it back
 	 * in with a different name so we ensure libnm-util is returning the right
 	 * error when it finds an entry in the connection hash that doesn't match
 	 * any setting in the connection.
 	 */
-	g_hash_table_steal (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
-	g_hash_table_insert (secrets, "asdfasdfasdfasdf", wsec_hash);
+	g_hash_table_ref (wsec_hash);
+	g_hash_table_remove (secrets, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME);
+	g_hash_table_insert (secrets, g_strdup ("asdfasdfasdfasdf"), wsec_hash);
 
 	success = nm_connection_update_secrets (connection, NULL, secrets, &error);
 	g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
 	g_assert (success == FALSE);
 
+	g_clear_error (&error);
+	g_hash_table_destroy (secrets);
 	g_object_unref (connection);
 }
 
@@ -716,6 +729,7 @@ test_update_secrets_null_setting_name_with_setting_hash (void)
 	g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND);
 	g_assert (!success);
 
+	g_clear_error (&error);
 	g_hash_table_destroy (secrets);
 	g_object_unref (connection);
 }
diff --git a/libnm-util/tests/test-setting-8021x.c b/libnm-util/tests/test-setting-8021x.c
index 4b37d92b..dfc07a80 100644
--- a/libnm-util/tests/test-setting-8021x.c
+++ b/libnm-util/tests/test-setting-8021x.c
@@ -188,6 +188,7 @@ test_phase2_private_key_import (const char *path,
 		g_object_get (s_8021x, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, &tmp_key, NULL);
 		ASSERT (tmp_key != NULL, "phase2-private-key-import", "missing private key value");
 		check_scheme_path (tmp_key, path);
+		g_byte_array_free (tmp_key, TRUE);
 	} else
 		g_assert_not_reached ();
 
@@ -249,6 +250,7 @@ test_wrong_password_keeps_data (const char *path, const char *password)
 	        "wrong-password-keeps-data", "unexpected missing error");
 	ASSERT (format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN,
 	        "wrong-password-keeps-data", "unexpected success reading private key format");
+	g_clear_error (&error);
 
 	/* Make sure the password hasn't changed */
 	pw = nm_setting_802_1x_get_private_key_password (s_8021x);
@@ -346,6 +348,7 @@ test_wrong_phase2_password_keeps_data (const char *path, const char *password)
 	        "wrong-phase2-password-keeps-data", "unexpected missing error");
 	ASSERT (format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN,
 	        "wrong-phase2-password-keeps-data", "unexpected success reading private key format");
+	g_clear_error (&error);
 
 	/* Make sure the password hasn't changed */
 	pw = nm_setting_802_1x_get_phase2_private_key_password (s_8021x);
diff --git a/libnm-util/tests/test-setting-dcb.c b/libnm-util/tests/test-setting-dcb.c
index 1c7d78b8..36192cd3 100644
--- a/libnm-util/tests/test-setting-dcb.c
+++ b/libnm-util/tests/test-setting-dcb.c
@@ -26,6 +26,7 @@
 #include <nm-utils.h>
 #include <nm-glib-compat.h>
 #include "nm-setting-dcb.h"
+#include "gsystem-local-alloc.h"
 
 #define DCB_FLAGS_ALL (NM_SETTING_DCB_FLAG_ENABLE | \
                        NM_SETTING_DCB_FLAG_ADVERTISE | \
@@ -34,7 +35,7 @@
 static void
 test_dcb_flags_valid (void)
 {
-	NMSettingDcb *s_dcb;
+	gs_unref_object NMSettingDcb *s_dcb = NULL;
 	GError *error = NULL;
 	gboolean success;
 	guint i;
@@ -87,7 +88,7 @@ test_dcb_flags_valid (void)
 static void
 test_dcb_flags_invalid (void)
 {
-	NMSettingDcb *s_dcb;
+	gs_unref_object NMSettingDcb *s_dcb = NULL;
 	GError *error = NULL;
 	gboolean success;
 
@@ -146,7 +147,7 @@ test_dcb_flags_invalid (void)
 static void
 test_dcb_app_priorities (void)
 {
-	NMSettingDcb *s_dcb;
+	gs_unref_object NMSettingDcb *s_dcb = NULL;
 	GError *error = NULL;
 	gboolean success;
 
@@ -208,7 +209,7 @@ test_dcb_app_priorities (void)
 static void
 test_dcb_priorities_valid (void)
 {
-	NMSettingDcb *s_dcb;
+	gs_unref_object NMSettingDcb *s_dcb = NULL;
 	GError *error = NULL;
 	gboolean success;
 	guint i;
@@ -267,7 +268,7 @@ test_dcb_priorities_valid (void)
 static void
 test_dcb_bandwidth_sums (void)
 {
-	NMSettingDcb *s_dcb;
+	gs_unref_object NMSettingDcb *s_dcb = NULL;
 	GError *error = NULL;
 	gboolean success;