From 700712e226b325f02421189f6fb52bff167876ce Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 25 Oct 2010 16:42:37 -0700 Subject: [PATCH] ofproto: Fix memory leak in handle_packet_out(). --- ofproto/ofproto.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 2ec7c8c4..1f2c22d1 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2945,14 +2945,12 @@ handle_packet_out(struct ofproto *p, struct ofconn *ofconn, flow_extract(&payload, 0, ofp_port_to_odp_port(ntohs(opo->in_port)), &flow); error = xlate_actions((const union ofp_action *) opo->actions, n_actions, &flow, p, &payload, &actions, NULL, NULL, NULL); - if (error) { - return error; + if (!error) { + dpif_execute(p->dpif, actions.actions, actions.n_actions, &payload); } - - dpif_execute(p->dpif, actions.actions, actions.n_actions, &payload); ofpbuf_delete(buffer); - return 0; + return error; } static void -- 2.30.2