From 5fcf647a28b8db092d57400978fb65cee1d52682 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 29 Aug 2013 14:56:59 -0400 Subject: [PATCH] nm-activation-request: Make use of libgsystem local allocations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just cleaner code. Reviewed-by: Pavel Šimerda --- libgsystem | 2 +- src/nm-activation-request.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libgsystem b/libgsystem index 033511a303..00bd926b02 160000 --- a/libgsystem +++ b/libgsystem @@ -1 +1 @@ -Subproject commit 033511a303748b2ca7c751f0f132cf9ec778d42e +Subproject commit 00bd926b02e30484942405379c23e493c048b793 diff --git a/src/nm-activation-request.c b/src/nm-activation-request.c index 389cdacf14..508b10db5d 100644 --- a/src/nm-activation-request.c +++ b/src/nm-activation-request.c @@ -27,6 +27,8 @@ #include #include +#include "libgsystem.h" + #include "nm-activation-request.h" #include "nm-logging.h" #include "nm-setting-wireless-security.h" @@ -227,8 +229,8 @@ nm_act_request_set_shared (NMActRequest *req, gboolean shared) for (iter = list; iter; iter = g_slist_next (iter)) { ShareRule *rule = (ShareRule *) iter->data; char *envp[1] = { NULL }; - char **argv; - char *cmd; + gs_strfreev char **argv = NULL; + gs_free char *cmd = NULL; cmd = g_strdup_printf ("%s --table %s %s %s", IPTABLES_PATH, @@ -255,9 +257,6 @@ nm_act_request_set_shared (NMActRequest *req, gboolean shared) WEXITSTATUS (status)); } } - g_free (cmd); - if (argv) - g_strfreev (argv); } g_slist_free (list);