ofproto: Don't leak struct ofproto's port array.
[openvswitch] / ofproto / ofproto.c
index 43054fa335e8465a80b528f18ec137fe9d9edd4e..3768eede02a7db716dfb495cbba04316524034cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -617,7 +617,7 @@ ofproto_set_rate_limit(struct ofproto *ofproto,
 }
 
 int
-ofproto_set_stp(struct ofproto *ofproto UNUSED, bool enable_stp)
+ofproto_set_stp(struct ofproto *ofproto OVS_UNUSED, bool enable_stp)
 {
     /* XXX */
     if (enable_stp) {
@@ -759,6 +759,8 @@ ofproto_destroy(struct ofproto *p)
 
     mac_learning_destroy(p->ml);
 
+    port_array_destroy(&p->ports);
+
     free(p);
 }