From 45073322b20253837a2281afdb4d59839495c626 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Tue, 17 Apr 2018 14:14:46 -0700 Subject: [PATCH] [augeas] Fix fuzz target that was crashing on a startup (fixes #1326). --- projects/augeas/augeas_escape_name_fuzzer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/augeas/augeas_escape_name_fuzzer.cc b/projects/augeas/augeas_escape_name_fuzzer.cc index 93bd2ca3a..10b9abf2a 100644 --- a/projects/augeas/augeas_escape_name_fuzzer.cc +++ b/projects/augeas/augeas_escape_name_fuzzer.cc @@ -23,7 +23,7 @@ int escape_match(const uint8_t *data, size_t size){ augeas *aug = aug_init(NULL, NULL, AUG_NONE); std::string data_string(reinterpret_cast(data), size); - char *out; + char *out = NULL; aug_escape_name(aug, data_string.c_str(), &out); if (out != NULL){ aug_match(aug, out, NULL); @@ -32,7 +32,7 @@ int escape_match(const uint8_t *data, size_t size){ aug_match(aug, data_string.c_str(), NULL); } aug_close(aug); - delete[] out; + free(out); return 0; }