mirror of https://github.com/ecmwf/eccodes.git
ECC-1185: Crash in codes_context_delete() call (Part 1)
This commit is contained in:
parent
03ab8348ba
commit
7a14817017
|
@ -388,5 +388,6 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
codes_handle_delete(h);
|
||||
grib_context_delete(grib_context_get_default());
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -214,7 +214,12 @@ static void destroy(grib_context* context, grib_action* act)
|
|||
|
||||
grib_context_free_persistent(context, act->name);
|
||||
grib_context_free_persistent(context, act->op);
|
||||
grib_context_free_persistent(context, act->name_space);
|
||||
if(act->name_space) {
|
||||
grib_context_free_persistent(context, act->name_space);
|
||||
}
|
||||
if (act->set)
|
||||
grib_context_free_persistent(context, act->set);
|
||||
if (act->defaultkey) {
|
||||
grib_context_free_persistent(context, act->defaultkey);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -530,6 +530,7 @@ void grib_codetable_delete(grib_context* c)
|
|||
for (i = 0; i < t->size; i++) {
|
||||
grib_context_free_persistent(c, t->entries[i].abbreviation);
|
||||
grib_context_free_persistent(c, t->entries[i].title);
|
||||
grib_context_free_persistent(c, t->entries[i].units);
|
||||
}
|
||||
grib_context_free_persistent(c, t->filename[0]);
|
||||
if (t->filename[1])
|
||||
|
|
|
@ -800,8 +800,16 @@ void grib_context_reset(grib_context* c)
|
|||
grib_smart_table_delete(c);
|
||||
c->smart_table = NULL;
|
||||
|
||||
if (c->grib_definition_files_dir)
|
||||
grib_context_free(c, c->grib_definition_files_dir);
|
||||
if (c->grib_definition_files_dir) {
|
||||
grib_string_list* next = c->grib_definition_files_dir;
|
||||
grib_string_list* cur = NULL;
|
||||
while (next) {
|
||||
cur = next;
|
||||
next = next->next;
|
||||
grib_context_free(c, cur->value);
|
||||
grib_context_free(c, cur);
|
||||
}
|
||||
}
|
||||
|
||||
if (c->multi_support_on)
|
||||
grib_multi_support_reset(c);
|
||||
|
@ -813,7 +821,7 @@ void grib_context_delete(grib_context* c)
|
|||
c = grib_context_get_default();
|
||||
|
||||
grib_hash_keys_delete(c->keys);
|
||||
grib_trie_delete(c->def_files);
|
||||
/*grib_trie_delete(c->def_files); TODO:masn */
|
||||
|
||||
grib_context_reset(c);
|
||||
if (c != &default_grib_context)
|
||||
|
|
|
@ -55,5 +55,6 @@ int main(int argc, char** argv)
|
|||
|
||||
fclose(fp);
|
||||
|
||||
grib_context_delete(grib_context_get_default());
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -52,5 +52,7 @@ int main(int argc, char* argv[])
|
|||
codes_handle_delete(h);
|
||||
}
|
||||
fclose(in);
|
||||
|
||||
grib_context_delete(grib_context_get_default());
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -121,5 +121,6 @@ int main(int argc, char** argv)
|
|||
fclose(in);
|
||||
}
|
||||
|
||||
grib_context_delete(grib_context_get_default());
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ int main(int argc, char* argv[])
|
|||
free(shortNames[i]);
|
||||
free(shortNames);
|
||||
|
||||
/*grib_context_delete(grib_context_get_default());*/
|
||||
grib_context_delete(grib_context_get_default());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
leak:process_elements
|
||||
leak:tests/bufr_ecc-517.c
|
||||
leak:src/action_class_rename.c
|
||||
leak:tests/grib_indexing.c
|
||||
|
|
|
@ -78,5 +78,6 @@ int main(int argc, char* argv[])
|
|||
count++;
|
||||
}
|
||||
|
||||
grib_context_delete(grib_context_get_default());
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue