summaryrefslogtreecommitdiff
path: root/lib/ovs-router.c
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2016-03-31 09:56:25 -0700
committerBen Pfaff <blp@ovn.org>2016-03-31 10:13:42 -0700
commit7209202eb863f655b8835fa0a3c7a541b405cf41 (patch)
tree37cf262dbfe2dda2416aa8a5d4d1636e85d157d4 /lib/ovs-router.c
parenta5e9c53ce4539dac32036ea3ba3b916bcbf560e0 (diff)
downloadopenvswitch-7209202eb863f655b8835fa0a3c7a541b405cf41.tar.gz
ovs-router: Fix memory leak at ovs_router_insert__.
Reported by Valgrind, testcase: ovn-controller-vtep - test vtep-lswitch. ovs_router_insert__ (ovs-router.c:185) route_table_handle_msg (route-table.c:299) route_table_reset (route-table.c:186) route_table_init (route-table.c:113) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/ovs-router.c')
-rw-r--r--lib/ovs-router.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ovs-router.c b/lib/ovs-router.c
index 0d52bf935..90e2f828d 100644
--- a/lib/ovs-router.c
+++ b/lib/ovs-router.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2015 Nicira, Inc.
+ * Copyright (c) 2014, 2015, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -192,6 +192,7 @@ ovs_router_insert__(uint8_t priority, const struct in6_addr *ip6_dst,
p->priority = priority;
err = get_src_addr(ip6_dst, output_bridge, &p->src_addr);
if (err) {
+ free(p);
return err;
}
/* Longest prefix matches first. */