ofproto: Fix memory leak in handle_packet_out().
authorBen Pfaff <blp@nicira.com>
Mon, 25 Oct 2010 23:42:37 +0000 (16:42 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 29 Oct 2010 16:48:47 +0000 (09:48 -0700)
ofproto/ofproto.c

index 2ec7c8c..1f2c22d 100644 (file)
@@ -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