diff mbox series

[libnftnl,1/4] flowtable: Fix memleak in error path of nftnl_flowtable_parse_devs()

Message ID 20191202222401.867-2-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series Fix covscan-detected issues | expand

Commit Message

Phil Sutter Dec. 2, 2019, 10:23 p.m. UTC
In error case, allocated dev_array is not freed.

Fixes: 7f99639dd9217 ("flowtable: device array dynamic allocation")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/flowtable.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/src/flowtable.c b/src/flowtable.c
index 324e80f7e6ad6..db319434b51c0 100644
--- a/src/flowtable.c
+++ b/src/flowtable.c
@@ -419,6 +419,7 @@  static int nftnl_flowtable_parse_devs(struct nlattr *nest,
 err:
 	while (len--)
 		xfree(dev_array[len]);
+	xfree(dev_array);
 	return -1;
 }