Skip to content
Snippets Groups Projects
Commit 758804ae authored by Michael Tüxen's avatar Michael Tüxen
Browse files

Plumb TCP related memory leaks.

parent e8276e93
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ int tcp_options_append(struct tcp_options *options,
memcpy(options->data + options->length, option, option->length);
options->length += option->length;
assert(options->length <= sizeof(options->data));
free(option);
return STATUS_OK;
}
......
......@@ -58,7 +58,7 @@ struct packet *new_tcp_packet(int address_family,
u16 tcp_payload_bytes,
u32 ack_sequence,
s32 window,
const struct tcp_options *tcp_options,
struct tcp_options *tcp_options,
bool ignore_ts_val,
bool abs_ts_ecr,
bool abs_seq,
......@@ -182,6 +182,7 @@ struct packet *new_tcp_packet(int address_family,
/* Copy TCP options into packet */
memcpy(tcp_option_start, tcp_options->data,
tcp_options->length);
free(tcp_options);
}
if (ignore_ts_val) {
......
......@@ -43,7 +43,7 @@ extern struct packet *new_tcp_packet(int address_family,
u16 tcp_payload_bytes,
u32 ack_sequence,
s32 window,
const struct tcp_options *tcp_options,
struct tcp_options *tcp_options,
bool ignore_ts_val,
bool abs_ts_ecr,
bool abs_seq,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment