diff options
author | Thomas Haller <thaller@redhat.com> | 2015-08-03 16:15:25 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2015-08-25 15:27:18 +0200 |
commit | 8143d895ca65f71aee71e65168a74fe1a4f21100 (patch) | |
tree | 659d3eb1f8bc88dc3fb81f52f905d10e9ba582a5 | |
parent | e97a334e375b936ac66864e6d69ffe75ffa22aa9 (diff) | |
download | NetworkManager-8143d895ca65f71aee71e65168a74fe1a4f21100.tar.gz |
dispatcher: use slice allocator for Request and ScriptInfo
-rw-r--r-- | callouts/nm-dispatcher.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c index 0999b1944f..98f61867a0 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 @@ -637,7 +637,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; @@ -668,7 +668,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); |