From 3624d2218bf05c9c2a5a737796d4a23cfc59aab4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 30 Jun 2020 15:06:53 +0100 Subject: [PATCH] Memory leaks --- tools/grib_tools.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/grib_tools.c b/tools/grib_tools.c index cb74e1774..2f2023596 100644 --- a/tools/grib_tools.c +++ b/tools/grib_tools.c @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/* - * C Implementation: grib_tools - * - */ - #include "grib_tools.h" #if HAVE_LIBJASPER /* Remove compiler warnings re macros being redefined */ @@ -567,9 +562,10 @@ static int grib_tool_index(grib_runtime_options* options) } navigate(options->index2->fields, options); - /* TODO(masn): memleak - * grib_context_free(c, options->index2->current); - */ + + if (options->index2) + grib_context_free(c, options->index2->current); + grib_tool_finalise_action(options); return 0;