lib/telemetry: fix memory leak
Checks
Commit Message
Free the `values` pointer before returning
from rte_telemetry_command_ports_all_stat_values()
to avoid memory leak.
Fixes: c12cefa379 ("telemetry: fix mapping of statistics")
CC: stable@dpdk.org
CC: bruce.richardson@intel.com
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
lib/librte_telemetry/rte_telemetry_parser.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 29/05/2019 13:43, Reshma Pattan wrote:
> Free the `values` pointer before returning
> from rte_telemetry_command_ports_all_stat_values()
> to avoid memory leak.
>
> Fixes: c12cefa379 ("telemetry: fix mapping of statistics")
> CC: stable@dpdk.org
> CC: bruce.richardson@intel.com
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> lib/librte_telemetry/rte_telemetry_parser.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_telemetry/rte_telemetry_parser.c b/lib/librte_telemetry/rte_telemetry_parser.c
> index 9bc16eef4..e9297021a 100644
> --- a/lib/librte_telemetry/rte_telemetry_parser.c
> +++ b/lib/librte_telemetry/rte_telemetry_parser.c
> @@ -342,6 +342,7 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
> goto fail;
> }
>
> + free(values);
> return 0;
>
> fail:
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
31/05/2019 15:15, Laatz, Kevin:
> On 29/05/2019 13:43, Reshma Pattan wrote:
> > Free the `values` pointer before returning
> > from rte_telemetry_command_ports_all_stat_values()
> > to avoid memory leak.
> >
> > Fixes: c12cefa379 ("telemetry: fix mapping of statistics")
> > CC: stable@dpdk.org
> > CC: bruce.richardson@intel.com
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
>
> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Applied, thanks
@@ -342,6 +342,7 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
goto fail;
}
+ free(values);
return 0;
fail: