From dae8ab9be9eda36bd88473dfa98c5fac3e382036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 14 Apr 2011 12:00:32 +0200 Subject: [PATCH] ifcfg-rh: fix memory leaks in tests (test-ifcfg-rh-utils.c) --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c index a6c54fd3d8..e32ad78901 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2009 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #include @@ -53,7 +53,7 @@ test_get_ifcfg_path (const char *desc, const char *path, const char *expected) { - const char *result; + char *result; result = utils_get_ifcfg_path (path); if (expected == NULL) { @@ -64,6 +64,7 @@ test_get_ifcfg_path (const char *desc, ASSERT (strcmp (result, expected) == 0, desc, "unexpected ifcfg name '%s' created for '%s'", result, path); } + g_free (result); } static void @@ -71,7 +72,7 @@ test_get_keys_path (const char *desc, const char *path, const char *expected) { - const char *result; + char *result; result = utils_get_keys_path (path); if (expected == NULL) { @@ -82,6 +83,7 @@ test_get_keys_path (const char *desc, ASSERT (strcmp (result, expected) == 0, desc, "unexpected extra path '%s' created for '%s'", result, path); } + g_free (result); } static void @@ -89,7 +91,7 @@ test_get_route_path (const char *desc, const char *path, const char *expected) { - const char *result; + char *result; result = utils_get_route_path (path); if (expected == NULL) { @@ -100,6 +102,7 @@ test_get_route_path (const char *desc, ASSERT (strcmp (result, expected) == 0, desc, "unexpected extra path '%s' created for '%s'", result, path); } + g_free (result); } static void