telemetry: fix memory leak
authorReshma Pattan <reshma.pattan@intel.com>
Wed, 29 May 2019 12:43:17 +0000 (13:43 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 18 Jun 2019 09:07:45 +0000 (12:07 +0300)
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
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
lib/librte_telemetry/rte_telemetry_parser.c

index 9bc16ee..e929702 100644 (file)
@@ -342,6 +342,7 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
                goto fail;
        }
 
+       free(values);
        return 0;
 
 fail: