mirror of
https://github.com/SciresM/hactool
synced 2024-11-22 20:13:08 +00:00
npdm: Free JSON buffer when done with it in npdm_save()
It's the caller's responsibility to free the buffer returned by cJSON, so we do that here to avoid a leak.
This commit is contained in:
parent
ab6fe349da
commit
2098e42ebe
1 changed files with 1 additions and 0 deletions
1
npdm.c
1
npdm.c
|
@ -677,6 +677,7 @@ void npdm_save(npdm_t *npdm, hactool_ctx_t *tool_ctx) {
|
|||
fprintf(stderr, "Failed to write JSON file!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
cJSON_free(json);
|
||||
fclose(f_json);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue