mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Fix memory leak on zero-length input on fuzz_http.c
This commit is contained in:
parent
143235873b
commit
1d8e9e8c69
@ -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);
|
dir_conn.base_.inbuf = buf_new_with_data((char*)stdin_buf, data_size);
|
||||||
if (!dir_conn.base_.inbuf) {
|
if (!dir_conn.base_.inbuf) {
|
||||||
log_debug(LD_GENERAL, "Zero-Length-Input\n");
|
log_debug(LD_GENERAL, "Zero-Length-Input\n");
|
||||||
return 0;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the headers */
|
/* 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);
|
log_debug(LD_GENERAL, "Result:\n%d\n", rv);
|
||||||
|
|
||||||
|
done:
|
||||||
/* Reset. */
|
/* Reset. */
|
||||||
tor_free(dir_conn.base_.address);
|
tor_free(dir_conn.base_.address);
|
||||||
buf_free(dir_conn.base_.inbuf);
|
buf_free(dir_conn.base_.inbuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user