Skip to content

Commit 5e1d58a

Browse files
Fix memory leak in sapi/fuzzer/fuzzer-unserializehash.c, sapi/fuzzer/fuzzer-json.c, sapi/fuzzer/fuzzer-mbregex.c
1 parent d8e7f36 commit 5e1d58a

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

sapi/fuzzer/fuzzer-json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
3636
data[Size] = '\0';
3737

3838
if (fuzzer_request_startup() == FAILURE) {
39+
free(data);
3940
return 0;
4041
}
4142

sapi/fuzzer/fuzzer-mbregex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
3636
data[Size] = '\0';
3737

3838
if (fuzzer_request_startup() == FAILURE) {
39+
free(data);
3940
return 0;
4041
}
4142

sapi/fuzzer/fuzzer-unserializehash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t FullSize) {
4040
orig_data[Size] = '\0';
4141

4242
if (fuzzer_request_startup() == FAILURE) {
43+
free(orig_data);
4344
return 0;
4445
}
4546

0 commit comments

Comments
 (0)