From fa2890879e7467e5bf3c8ff0781b8f6f893dc810 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 11 Jul 2015 23:10:04 +0200 Subject: [PATCH] lib: fix memory leak when handling MED location data When formatting fixed precision data, the result was copied into the atom but the original wasn't freed. --- src/lib/atoms/med.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/atoms/med.c b/src/lib/atoms/med.c index c274d4c9..305bd55c 100644 --- a/src/lib/atoms/med.c +++ b/src/lib/atoms/med.c @@ -497,6 +497,7 @@ read_fixed_precision(lldpctl_atom_t *atom, return NULL; } strlcpy(stored, result, len); + free(result); return stored; } -- 2.39.5