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.
This commit is contained in:
Thomas Haller 2016-02-28 13:01:32 +01:00
parent bd797e9fe1
commit a3f9115c0b

View file

@ -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 {