From 1abe0c8285100e31a4688b3b09023eb3ad942394 Mon Sep 17 00:00:00 2001 From: Björn Svensson Date: Thu, 1 Sep 2022 15:32:53 +0200 Subject: fuzzer: No alloc in redisFormatCommand() when fail --- fuzzing/format_command_fuzzer.c | 5 ++--- 1 file 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; } -- cgit v1.2.3