diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-01-11 13:24:48 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-30 08:37:27 -0500 |
commit | 1d8e9e8c699e68cdbb33ab41ccbd65e3dab8ff6b (patch) | |
tree | e58a4e47b48e6107103595689fe4ad96f748bd8a /src | |
parent | 143235873ba0229f83ce69c4247ba8d3c459629f (diff) | |
download | tor-1d8e9e8c699e68cdbb33ab41ccbd65e3dab8ff6b.tar.gz tor-1d8e9e8c699e68cdbb33ab41ccbd65e3dab8ff6b.zip |
Fix memory leak on zero-length input on fuzz_http.c
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/fuzz_http.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/fuzz/fuzz_http.c b/src/test/fuzz/fuzz_http.c index f069900a2c..caad0b2f02 100644 --- a/src/test/fuzz/fuzz_http.c +++ b/src/test/fuzz/fuzz_http.c @@ -107,7 +107,7 @@ fuzz_main(const uint8_t *stdin_buf, size_t data_size) dir_conn.base_.inbuf = buf_new_with_data((char*)stdin_buf, data_size); if (!dir_conn.base_.inbuf) { log_debug(LD_GENERAL, "Zero-Length-Input\n"); - return 0; + goto done; } /* Parse the headers */ @@ -122,6 +122,7 @@ fuzz_main(const uint8_t *stdin_buf, size_t data_size) log_debug(LD_GENERAL, "Result:\n%d\n", rv); + done: /* Reset. */ tor_free(dir_conn.base_.address); buf_free(dir_conn.base_.inbuf); |