mirror of https://github.com/ecmwf/eccodes.git
ECC-991: Memory leak fix and cleanup
This commit is contained in:
parent
957bdfb35b
commit
ee8fec3143
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue