summaryrefslogtreecommitdiff
path: root/fuzzing
diff options
context:
space:
mode:
authorBjörn Svensson <bjorn.a.svensson@est.tech>2022-09-01 15:32:53 +0200
committerMichael Grunder <michael.grunder@gmail.com>2022-09-01 10:35:07 -0700
commit1abe0c8285100e31a4688b3b09023eb3ad942394 (patch)
treeda5d8eeee0516aa7627f22506d139f3fc4ab7b0c /fuzzing
parent329eaf9bae314f8bc307c809340b262f67c2ce36 (diff)
fuzzer: No alloc in redisFormatCommand() when fail
Diffstat (limited to 'fuzzing')
-rw-r--r--fuzzing/format_command_fuzzer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fuzzing/format_command_fuzzer.c b/fuzzing/format_command_fuzzer.c
index 91adeac..de125e0 100644
--- a/fuzzing/format_command_fuzzer.c
+++ b/fuzzing/format_command_fuzzer.c
@@ -48,10 +48,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
memcpy(new_str, data, size);
new_str[size] = '\0';
- redisFormatCommand(&cmd, new_str);
-
- if (cmd != NULL)
+ if (redisFormatCommand(&cmd, new_str) != -1)
hi_free(cmd);
+
free(new_str);
return 0;
}