diff mbox series

lib/telemetry: fix memory leak

Message ID 20190529124317.30611-1-reshma.pattan@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series lib/telemetry: fix memory leak | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail Compilation issues

Commit Message

Reshma Pattan May 29, 2019, 12:43 p.m. UTC
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

Kevin Laatz May 31, 2019, 12:15 p.m. UTC | #1
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>
Thomas Monjalon June 18, 2019, 9:10 a.m. UTC | #2
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
diff mbox series

Patch

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: