fix two mem leaks detected by cppcheck

This commit is contained in:
hexcoder- 2020-11-12 20:26:53 +01:00
parent 14e76cf3c9
commit ffe41e6fce
3 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,7 @@ my_mutator_t *afl_custom_init(afl_state_t *afl, unsigned int seed) {
if ((data->mutator_buf = malloc(MAX_FILE)) == NULL) { if ((data->mutator_buf = malloc(MAX_FILE)) == NULL) {
free(data);
perror("mutator_buf alloc"); perror("mutator_buf alloc");
return NULL; return NULL;

View File

@ -50,6 +50,7 @@ extern "C" my_mutator_t *afl_custom_init(afl_state_t *afl, unsigned int seed) {
if ((data->mutator_buf = (u8 *)malloc(MAX_FILE)) == NULL) { if ((data->mutator_buf = (u8 *)malloc(MAX_FILE)) == NULL) {
free(data);
perror("mutator_buf alloc"); perror("mutator_buf alloc");
return NULL; return NULL;

@ -1 +1 @@
Subproject commit 0bf26f6c2601e1c1c84998551ed7d50b4108fbdf Subproject commit c6d6647161a32bae88785a618fcd828d1711d9e6