summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-08-03 16:15:25 +0200
committerThomas Haller <thaller@redhat.com>2015-08-04 17:45:16 +0200
commit53dcba4fc2ee05fef673b3f506b090531802ce5e (patch)
tree621889c0bbb7fb0e29f3dfd9463bfeecd1510494
parent36407a564b7253a058a15b314a2422fcdc6ca72a (diff)
downloadNetworkManager-53dcba4fc2ee05fef673b3f506b090531802ce5e.tar.gz
dispatcher: use slice allocator for Request and ScriptInfo
-rw-r--r--callouts/nm-dispatcher.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c
index 3b72712b7a..d25f761035 100644
--- a/callouts/nm-dispatcher.c
+++ b/callouts/nm-dispatcher.c
@@ -140,7 +140,7 @@ script_info_free (gpointer ptr)
g_free (info->script);
g_free (info->error);
- g_free (info);
+ g_slice_free (ScriptInfo, info);
}
static void
@@ -155,7 +155,7 @@ request_free (Request *request)
if (request->scripts)
g_ptr_array_free (request->scripts, TRUE);
- g_free (request);
+ g_slice_free (Request, request);
}
static gboolean
@@ -635,7 +635,7 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
nm_clear_g_source (&quit_id);
- request = g_malloc0 (sizeof (*request));
+ request = g_slice_new0 (Request);
request->handler = h;
request->debug = request_debug || debug;
request->context = context;
@@ -666,7 +666,9 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
request->scripts = g_ptr_array_new_full (5, script_info_free);
for (iter = sorted_scripts; iter; iter = g_slist_next (iter)) {
- ScriptInfo *s = g_malloc0 (sizeof (*s));
+ ScriptInfo *s;
+
+ s = g_slice_new0 (ScriptInfo);
s->request = request;
s->script = iter->data;
s->wait = script_must_wait (s->script);