aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-08-20 07:15:39 -0700
committerBen Pfaff <blp@nicira.com>2013-08-20 07:15:39 -0700
commite5b90c6a53a50778eac7af9b0ed0f8ad39e7dbf0 (patch)
tree55ec8361401ff8ebd0833b6d5302d24a4c9fb5b6
parentcf7eed48d44f29c2d2670558c9370b7bf9d7e1e5 (diff)
ofproto-dpif: Fix memory leak in handle_flow_miss().
Every xlate_actions() needs a corresponding xlate_out_uninit(), but the call in handle_flow_miss() lacked one. struct xlate_out has a built-in 256-byte actions stub, so the bug only showed up for lots of actions. Bug #19198. Reported-by: Ronald Lee <ronaldlee@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
-rw-r--r--ofproto/ofproto-dpif.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 20a180e2..0fdd1fb4 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3898,10 +3898,12 @@ handle_flow_miss(struct flow_miss *miss, struct flow_miss_op *ops,
if (miss->key_fitness == ODP_FIT_TOO_LITTLE
|| !flow_miss_should_make_facet(miss, &xout.wc)) {
handle_flow_miss_without_facet(rule, &xout, miss, ops, n_ops);
+ xlate_out_uninit(&xout);
return;
}
facet = facet_create(miss, rule, &xout, stats);
+ xlate_out_uninit(&xout);
stats = NULL;
}
handle_flow_miss_with_facet(miss, facet, now, stats, ops, n_ops);
@@ -7114,7 +7116,10 @@ xlate_out_uninit(struct xlate_out *xout)
}
/* Translates the 'ofpacts_len' bytes of "struct ofpacts" starting at 'ofpacts'
- * into datapath actions in 'odp_actions', using 'ctx'. */
+ * into datapath actions in 'odp_actions', using 'ctx'.
+ *
+ * The caller must take responsibility for eventually freeing 'xout', with
+ * xlate_out_uninit(). */
static void
xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
{