From: Ben Pfaff Date: Mon, 25 Oct 2010 23:42:37 +0000 (-0700) Subject: ofproto: Fix memory leak in handle_packet_out(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=700712e226b325f02421189f6fb52bff167876ce;p=openvswitch ofproto: Fix memory leak in handle_packet_out(). --- 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