[ovs-dev] [threaded-learning 05/25] ofproto: Avoid gratuitous memory allocation and free.

Ethan Jackson ethan at nicira.com
Wed Sep 11 20:07:59 UTC 2013


Acked-by: Ethan Jackson <ethan at nicira.com>


On Tue, Sep 10, 2013 at 10:27 PM, Ben Pfaff <blp at nicira.com> wrote:
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  ofproto/ofproto.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 388463a..b027873 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -1717,10 +1717,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);
>      }
>  }
>
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list