ovs-ofctl: Free group buckets.
authorSimon Horman <simon.horman@netronome.com>
Fri, 31 Oct 2014 08:14:46 +0000 (17:14 +0900)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Oct 2014 21:34:59 +0000 (14:34 -0700)
To some extent this is cosmetic because ovs-ovfctl will immediately
exit. However, it does seem to be in keeping with freeing 'gms' in
ofctl_group_mod_file().

Found by inspection using make check-valgrind.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
utilities/ovs-ofctl.c

index f0ea15f..211c276 100644 (file)
@@ -2113,6 +2113,7 @@ ofctl_group_mod_file(int argc OVS_UNUSED, char *argv[], uint16_t command)
     enum ofputil_protocol usable_protocols;
     size_t n_gms = 0;
     char *error;
+    int i;
 
     error = parse_ofp_group_mod_file(argv[2], command, &gms, &n_gms,
                                      &usable_protocols);
@@ -2120,6 +2121,9 @@ ofctl_group_mod_file(int argc OVS_UNUSED, char *argv[], uint16_t command)
         ovs_fatal(0, "%s", error);
     }
     ofctl_group_mod__(argv[1], gms, n_gms);
+    for (i = 0; i < n_gms; i++) {
+        ofputil_bucket_list_destroy(&gms[i].buckets);
+    }
     free(gms);
 }
 
@@ -2139,6 +2143,7 @@ ofctl_group_mod(int argc, char *argv[], uint16_t command)
             ovs_fatal(0, "%s", error);
         }
         ofctl_group_mod__(argv[1], &gm, 1);
+        ofputil_bucket_list_destroy(&gm.buckets);
     }
 }