summaryrefslogtreecommitdiff
path: root/callouts
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-10-22 12:31:59 +0200
committerThomas Haller <thaller@redhat.com>2013-10-22 19:53:46 +0200
commite670528778d0034693eabb140f1f2709e5e78a3a (patch)
tree03fcf6b60887780278a5967172e978c5a97b5b8a /callouts
parent5a0d3c724d16a9c51bb62bf0a117549022a32646 (diff)
dispatcher: fix memory leak in nm-dispatcher-action
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'callouts')
-rw-r--r--callouts/nm-dispatcher-action.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/callouts/nm-dispatcher-action.c b/callouts/nm-dispatcher-action.c
index a9ed37ada2..d37a08e1b2 100644
--- a/callouts/nm-dispatcher-action.c
+++ b/callouts/nm-dispatcher-action.c
@@ -134,9 +134,10 @@ request_free (Request *request)
g_free (request->action);
g_free (request->iface);
g_strfreev (request->envp);
- if (request->scripts)
+ if (request->scripts) {
g_ptr_array_foreach (request->scripts, (GFunc) script_info_free, NULL);
- g_ptr_array_free (request->scripts, TRUE);
+ g_ptr_array_free (request->scripts, TRUE);
+ }
}
static gboolean
@@ -172,7 +173,7 @@ next_script (gpointer user_data)
}
/* All done */
- results = g_ptr_array_sized_new (request->scripts->len);
+ results = g_ptr_array_new_full (request->scripts->len, (GDestroyNotify) g_value_array_free);
for (i = 0; i < request->scripts->len; i++) {
ScriptInfo *script = g_ptr_array_index (request->scripts, i);
GValue elt = G_VALUE_INIT;
@@ -203,6 +204,7 @@ next_script (gpointer user_data)
dbus_g_method_return (request->context, results);
request_free (request);
+ g_ptr_array_unref (results);
return FALSE;
}