aboutsummaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorHosein Ghahremanzadeh <hgsilverman@gmail.com>2020-10-21 06:05:11 -0700
committerGitHub <noreply@github.com>2020-10-21 15:05:11 +0200
commitbb33d579714e140650e13325c39b0d372888b717 (patch)
tree9e49017e8548faf18617e764dc37ec2b028455be /fuzz
parent13d99a93901ac6f8da493b9a026c04be96528799 (diff)
Fix a memory leak on fuzzing code (#1036)
After allocation of pcap_buffer it is necessary to free it
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/fuzz_ndpi_reader.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fuzz/fuzz_ndpi_reader.c b/fuzz/fuzz_ndpi_reader.c
index 9f73eb4e9..9cfffaf26 100644
--- a/fuzz/fuzz_ndpi_reader.c
+++ b/fuzz/fuzz_ndpi_reader.c
@@ -151,6 +151,7 @@ int main(int argc, char ** argv)
if (fread(pcap_buffer, sizeof(*pcap_buffer), pcap_file_size, pcap_file) != pcap_file_size) {
perror("fread failed");
fclose(pcap_file);
+ free(pcap_buffer);
return 1;
}