mirror of https://github.com/ecmwf/eccodes.git
Memory leaks
This commit is contained in:
parent
7b8a892508
commit
9b163f5308
|
@ -384,6 +384,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len)
|
|||
}
|
||||
|
||||
if (str == 0 || strlen(str) == 0) {
|
||||
grib_context_free(c, str);
|
||||
*len = 0;
|
||||
*val = 0;
|
||||
return ret;
|
||||
|
|
|
@ -261,6 +261,8 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err)
|
|||
dictionary = grib_trie_new(c);
|
||||
|
||||
while (fgets(line, sizeof(line) - 1, f)) {
|
||||
DebugAssert( strlen(line) > 0 );
|
||||
if (line[0] == '#') continue;
|
||||
list = string_split(line, "|");
|
||||
grib_trie_insert(dictionary, list[0], list);
|
||||
}
|
||||
|
@ -276,6 +278,8 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err)
|
|||
}
|
||||
|
||||
while (fgets(line, sizeof(line) - 1, f)) {
|
||||
DebugAssert( strlen(line) > 0 );
|
||||
if (line[0] == '#') continue;
|
||||
list = string_split(line, "|");
|
||||
grib_trie_insert(dictionary, list[0], list);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue