On Wed, Dec 21, 2016 at 02:04:32PM -0800, Justin Pettit wrote:
> Signed-off-by: Justin Pettit <jpet...@ovn.org>
> ---
>  ovn/utilities/ovn-trace.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c
> index 71798f8..6d8e514 100644
> --- a/ovn/utilities/ovn-trace.c
> +++ b/ovn/utilities/ovn-trace.c
> @@ -1447,7 +1447,9 @@ trace(const char *dp_s, const char *flow_s)
>      char *error = expr_parse_microflow(flow_s, &symtab, &address_sets,
>                                         ovntrace_lookup_port, dp, &uflow);
>      if (error) {
> -        return xasprintf("error parsing flow: %s\n", error);
> +        char *s = xasprintf("error parsing flow: %s\n", error);
> +        free(error);
> +        return s;
>      }

I've often wished for a %s-like format specifier that frees the string
after it prints it.

Acked-by: Ben Pfaff <b...@ovn.org>
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to