summaryrefslogtreecommitdiff
path: root/examples/l3fwd-acl
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2014-12-16 17:05:08 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-12-17 01:04:06 +0100
commit225979558a2ab53149153d1c6c51983703a1b44c (patch)
tree0bd02fde679f3baf2292fd5507479fbb1e47785a /examples/l3fwd-acl
parent6f78a6651f2c64b3a931a347628cd23e06ea4d99 (diff)
downloaddpdk-225979558a2ab53149153d1c6c51983703a1b44c.zip
dpdk-225979558a2ab53149153d1c6c51983703a1b44c.tar.gz
dpdk-225979558a2ab53149153d1c6c51983703a1b44c.tar.xz
examples/l3fwd-acl: fix possible memory leak
At error app_acl_init() can return without freeing dynamically allocated memory. Not really a big problem, as if app_acl_init() fails, then application would terminate immediately anyway. Though it is a good coding practise to make a function to cleanup after itself. Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples/l3fwd-acl')
-rw-r--r--examples/l3fwd-acl/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 4487c95..022ccab 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1247,6 +1247,10 @@ app_acl_init(void)
acl_log("Socket %d of lcore %u is out "
"of range %d\n",
socketid, lcore_id, NB_SOCKETS);
+ free(route_base_ipv4);
+ free(route_base_ipv6);
+ free(acl_base_ipv4);
+ free(acl_base_ipv6);
return -1;
}