aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-04-23 13:22:10 -0700
committerBen Pfaff <blp@nicira.com>2012-04-25 14:42:19 -0700
commit1638ff192b0e4b48e50986f6b5789ccf1da842bc (patch)
tree9484ed78fba6f85ba500a9482205b6ef87e063b1
parentc71db22fc0795251d9ddfca8d2789ab584261129 (diff)
Fix memory leaks.
Found by valgrind. Reported-by: Ethan Jackson <ethan@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--lib/netdev-vport.c3
-rw-r--r--lib/route-table.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index 92096e3f..55209e4d 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011 Nicira Networks.
+ * Copyright (c) 2010, 2011, 2012 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -198,6 +198,7 @@ netdev_vport_destroy(struct netdev_dev *netdev_dev_)
{
struct netdev_dev_vport *netdev_dev = netdev_dev_vport_cast(netdev_dev_);
+ ofpbuf_delete(netdev_dev->options);
route_table_unregister();
free(netdev_dev);
}
diff --git a/lib/route-table.c b/lib/route-table.c
index 58c1b601..8e54b284 100644
--- a/lib/route-table.c
+++ b/lib/route-table.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Nicira Networks.
+ * Copyright (c) 2011, 2012 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -246,6 +246,7 @@ route_table_reset(void)
rtmsg->rtgen_family = AF_INET;
nl_dump_start(&dump, rtnl_sock, &request);
+ ofpbuf_uninit(&request);
while (nl_dump_next(&dump, &reply)) {
struct route_table_msg msg;
@@ -437,6 +438,8 @@ name_table_reset(void)
rtmsg->rtgen_family = AF_INET;
nl_dump_start(&dump, rtnl_sock, &request);
+ ofpbuf_uninit(&request);
+
while (nl_dump_next(&dump, &reply)) {
struct rtnetlink_link_change change;