diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-28 13:01:32 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-29 14:08:00 +0100 |
commit | a3f9115c0bd37613ef8e22dd0aece9a14b4ef442 (patch) | |
tree | c8245c0dd55abbf42a1f92dbc261f446fbc702a0 | |
parent | bd797e9fe147cd8ee2e7ca3c556e5cf67f4a79ec (diff) | |
download | NetworkManager-a3f9115c0bd37613ef8e22dd0aece9a14b4ef442.tar.gz |
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.
-rw-r--r-- | src/devices/nm-lldp-listener.c | 4 |
1 files changed, 1 insertions, 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 { |