From a3f9115c0bd37613ef8e22dd0aece9a14b4ef442 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 28 Feb 2016 13:01:32 +0100 Subject: [PATCH] lldp: fix calling free on memory returned by systemd systemd's malloc() must be matched by free() and not g_free(). Thereby, use a cleanup attribute. --- src/devices/nm-lldp-listener.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c index 9d82c3d282..f4ac90a22d 100644 --- a/src/devices/nm-lldp-listener.c +++ b/src/devices/nm-lldp-listener.c @@ -226,7 +226,7 @@ static void process_lldp_neighbors (NMLldpListener *self) { NMLldpListenerPrivate *priv = NM_LLDP_LISTENER_GET_PRIVATE (self); - sd_lldp_packet **packets = NULL; + nm_auto_free sd_lldp_packet **packets = NULL; GHashTable *hash; int num, i; @@ -353,8 +353,6 @@ next_packet: sd_lldp_packet_unref (packets[i]); } - g_free (packets); - if (lldp_hash_table_equal (priv->lldp_neighbors, hash)) { g_hash_table_destroy (hash); } else {