Memory leak

This commit is contained in:
Shahram Najm 2020-04-09 21:14:56 +01:00
parent b86f47e43c
commit 6541872ca3
2 changed files with 9 additions and 7 deletions

View File

@ -482,13 +482,13 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment)
static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment)
{
grib_dumper_bufr_decode_C* self = (grib_dumper_bufr_decode_C*)d;
char** values = NULL;
size_t size = 0;
grib_context* c = NULL;
int err = 0;
long count = 0;
int r = 0;
grib_handle* h = grib_handle_of_accessor(a);
char** values;
size_t size = 0, i = 0;
grib_context* c = NULL;
int err = 0;
long count = 0;
int r = 0;
grib_handle* h = grib_handle_of_accessor(a);
c = a->context;
@ -542,6 +542,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm
depth -= 2;
}
for (i = 0; i < size; i++) grib_context_free(c, values[i]);
grib_context_free(c, values);
(void)err; /* TODO */
}

View File

@ -665,6 +665,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm
depth -= 2;
}
for (i = 0; i < size; i++) grib_context_free(c, values[i]);
grib_context_free(c, values);
(void)err; /* TODO */
}