[dpdk-dev] [PATCH 2/2] sched: fix possible mem leak on initialize

Tonghao Zhang xiangxia.m.yue at gmail.com
Tue Dec 11 03:54:24 CET 2018


ping
On Wed, Nov 28, 2018 at 9:56 PM Tonghao Zhang <xiangxia.m.yue at gmail.com> wrote:
>
> In some case, we may create sched port dynamically,
> if err when creating so memory will leak.
>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> ---
>  lib/librte_sched/rte_sched.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
> index 17de6e6..a3adcca 100644
> --- a/lib/librte_sched/rte_sched.c
> +++ b/lib/librte_sched/rte_sched.c
> @@ -724,6 +724,7 @@ struct rte_sched_port *
>                                     bmp_mem_size);
>         if (port->bmp == NULL) {
>                 RTE_LOG(ERR, SCHED, "Bitmap init error\n");
> +               rte_free(port);
>                 return NULL;
>         }
>
> --
> 1.8.3.1
>


More information about the dev mailing list