chiark / gitweb /
lldp: fix double free
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 31 Dec 2014 14:58:27 +0000 (15:58 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 31 Dec 2014 14:58:27 +0000 (15:58 +0100)
'k' is marked as _cleanup_free_ so reset it to NULL if we free it
explicitly.

src/libsystemd-network/sd-lldp.c

index 08cd092..74ea810 100644 (file)
@@ -484,6 +484,7 @@ int sd_lldp_save(sd_lldp *lldp, const char *lldp_file) {
                                 t = strappend(s, buf);
 
                                 free(k);
+                                k = NULL;
                         } else {
 
                                 mac = port_id;