]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lib: fix memory leak when handling MED location data
authorVincent Bernat <vincent@bernat.im>
Sat, 11 Jul 2015 21:10:04 +0000 (23:10 +0200)
committerVincent Bernat <vincent@bernat.im>
Sat, 11 Jul 2015 21:10:04 +0000 (23:10 +0200)
When formatting fixed precision data, the result was copied into the
atom but the original wasn't freed.

src/lib/atoms/med.c

index c274d4c9e949b0d14cbb259a590286bd49a9e6d8..305bd55c771e0d13b1c1cddaf81e2adedfa2cbe5 100644 (file)
@@ -497,6 +497,7 @@ read_fixed_precision(lldpctl_atom_t *atom,
                return NULL;
        }
        strlcpy(stored, result, len);
+       free(result);
        return stored;
 }