[ovs-dev] [PATCH] ofp-actions: Fix memory leak on error path.

Yifeng Sun pkusunyifeng at gmail.com
Mon Apr 13 16:26:14 UTC 2020


Looks good to me, thanks.

Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>


On Mon, Apr 13, 2020 at 8:43 AM William Tu <u9012063 at gmail.com> wrote:

> Need to free the memory before return. Detected by gcc10.
>
> Signed-off-by: William Tu <u9012063 at gmail.com>
> ---
>  lib/ofp-actions.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index ef8b2b4527f9..a94d1a7ca918 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -5966,6 +5966,7 @@ parse_CLONE(char *arg, const struct
> ofpact_parse_params *pp)
>      clone = pp->ofpacts->header;
>
>      if (ofpbuf_oversized(pp->ofpacts)) {
> +        free(error);
>          return xasprintf("input too big");
>      }
>
> --
> 2.7.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


More information about the dev mailing list