ECC-991: Memory leak fix and cleanup

This commit is contained in:
Shahram Najm 2019-11-20 12:25:38 +00:00
parent 957bdfb35b
commit ee8fec3143
2 changed files with 25 additions and 21 deletions

View File

@ -23,6 +23,7 @@ int main(int argc, char* argv[])
int requested_print_keys_count = MAX_KEYS; int requested_print_keys_count = MAX_KEYS;
codes_values requested_print_keys[MAX_KEYS]; codes_values requested_print_keys[MAX_KEYS];
/* Usage: prog keys file */
assert (argc == 3); assert (argc == 3);
keys = argv[1]; /* comma-separated like bufr_ls/bufr_get */ keys = argv[1]; /* comma-separated like bufr_ls/bufr_get */
@ -50,6 +51,9 @@ int main(int argc, char* argv[])
} }
free(header_array); free(header_array);
for (i=0; i<requested_print_keys_count; ++i) {
free((char*)requested_print_keys[i].name);
}
return 0; return 0;
} }