summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-03-29 10:48:01 +0200
committerThomas Haller <thaller@redhat.com>2016-03-29 12:18:15 +0200
commit03d5479320cd8a97de2bc39d7f2d27d74c83c1b0 (patch)
tree7efd70cc54a924cdc1e0dc85db0b486c79e816d7
parent0ea388023837347ef0e86fc8e44ab2a1ec01edd5 (diff)
downloadNetworkManager-03d5479320cd8a97de2bc39d7f2d27d74c83c1b0.tar.gz
policy: use slice allocator for PendingSecondaryData
-rw-r--r--src/nm-policy.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c
index c7d5481777..76303f2485 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -759,7 +759,7 @@ pending_secondary_data_new (NMDevice *device, GSList *secondaries)
{
PendingSecondaryData *data;
- data = g_malloc0 (sizeof (PendingSecondaryData));
+ data = g_slice_new (PendingSecondaryData);
data->device = g_object_ref (device);
data->secondaries = secondaries;
return data;
@@ -770,8 +770,7 @@ pending_secondary_data_free (PendingSecondaryData *data)
{
g_object_unref (data->device);
g_slist_free_full (data->secondaries, g_object_unref);
- memset (data, 0, sizeof (*data));
- g_free (data);
+ g_slice_free (PendingSecondaryData, data);
}
static void