Skip to content

Commit

Permalink
Fix memory leaks.
Browse files Browse the repository at this point in the history
Found by valgrind.

Reported-by: Ethan Jackson <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
blp committed Apr 25, 2012
1 parent 36f3999 commit 896b327
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/netdev-vport.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion lib/route-table.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 896b327

Please sign in to comment.