ofproto: Avoid gratuitous memory allocation and free.
authorBen Pfaff <blp@nicira.com>
Sat, 7 Sep 2013 02:23:07 +0000 (19:23 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 13 Sep 2013 00:43:05 +0000 (17:43 -0700)
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto.c

index 3d5df24..3ae6cce 100644 (file)
@@ -1752,10 +1752,9 @@ ofproto_add_flow(struct ofproto *ofproto, const struct match *match,
         fm.match = *match;
         fm.priority = priority;
         fm.buffer_id = UINT32_MAX;
-        fm.ofpacts = xmemdup(ofpacts, ofpacts_len);
+        fm.ofpacts = ofpacts;
         fm.ofpacts_len = ofpacts_len;
         add_flow(ofproto, NULL, &fm, NULL);
-        free(fm.ofpacts);
     }
 }