@@ -1297,6 +1297,7 @@ bundle_flow_mod__(const char *remote, struct ofputil_flow_mod *fms,
size_t n_fms, enum ofputil_protocol usable_protocols)
{
enum ofputil_protocol protocol;
+ struct ofpbuf *request, *request_next;
struct vconn *vconn;
struct ovs_list requests;
size_t i;
@@ -1309,13 +1310,18 @@ bundle_flow_mod__(const char *remote, struct ofputil_flow_mod *fms,
for (i = 0; i < n_fms; i++) {
struct ofputil_flow_mod *fm = &fms[i];
- struct ofpbuf *request = ofputil_encode_flow_mod(fm, protocol);
+ request = ofputil_encode_flow_mod(fm, protocol);
list_push_back(&requests, &request->list_node);
free(CONST_CAST(struct ofpact *, fm->ofpacts));
}
bundle_transact(vconn, &requests, OFPBF_ORDERED | OFPBF_ATOMIC);
+
+ LIST_FOR_EACH_SAFE (request, request_next, list_node, &requests) {
+ ofpbuf_delete(request);
+ }
+
vconn_close(vconn);
}
@@ -2936,6 +2942,7 @@ ofctl_replace_flows(struct ovs_cmdl_context *ctx)
{
enum { FILE_IDX = 0, SWITCH_IDX = 1 };
enum ofputil_protocol usable_protocols, protocol;
+ struct ofpbuf *request, *request_next;
struct flow_tables tables;
struct classifier *cls;
struct ovs_list requests;
@@ -2982,6 +2989,11 @@ ofctl_replace_flows(struct ovs_cmdl_context *ctx)
} else {
transact_multiple_noreply(vconn, &requests);
}
+
+ LIST_FOR_EACH_SAFE (request, request_next, list_node, &requests) {
+ ofpbuf_delete(request);
+ }
+
vconn_close(vconn);
fte_free_all(&tables);