]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lib: fix a memory leak when setting LLDP-MED ELIN number
authorVincent Bernat <bernat@luffy.cx>
Fri, 4 Jan 2013 22:07:00 +0000 (23:07 +0100)
committerVincent Bernat <bernat@luffy.cx>
Fri, 4 Jan 2013 22:07:00 +0000 (23:07 +0100)
src/lib/atom-private.c

index 185240f9eb2619d8b922f107dbd36770d8734f4e..12efa5b93e8158d0d73c6461ca7dd2a4b0ffd780 100644 (file)
@@ -1703,6 +1703,7 @@ _lldpctl_atom_set_int_med_location(lldpctl_atom_t *atom, lldpctl_key_t key,
                        return atom;
                case LLDP_MED_LOCFORMAT_ELIN:
                        mloc->location->format = value;
+                       if (mloc->location->data) free(mloc->location->data);
                        mloc->location->data = NULL;
                        mloc->location->data_len = 0;
                        return atom;