From 6ab8b360a505c90f14057260433ee4e86cf0d962 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 31 Dec 2008 18:24:39 +0000 Subject: removed useless malloc for seq_window_t --- src/uanytun.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/uanytun.c') diff --git a/src/uanytun.c b/src/uanytun.c index c2f5585..26f4bea 100644 --- a/src/uanytun.c +++ b/src/uanytun.c @@ -76,11 +76,11 @@ int main_loop(tun_device_t* dev, udp_socket_t* sock, options_t* opt) return_value = ret; } - seq_win_t* seq_win; - seq_win_init(&seq_win, opt->seq_window_size_); - if(!seq_win) { + seq_win_t seq_win; + ret = seq_win_init(&seq_win, opt->seq_window_size_); + if(ret) { printf("could not initialize sequence window"); - return_value = -1; + return_value = ret; } while(!return_value) { @@ -146,7 +146,7 @@ int main_loop(tun_device_t* dev, udp_socket_t* sock, options_t* opt) if(encrypted_packet_get_mux(&encrypted_packet) != opt->mux_) continue; - int result = seq_win_check_and_add(seq_win, encrypted_packet_get_sender_id(&encrypted_packet), encrypted_packet_get_seq_nr(&encrypted_packet)); + int result = seq_win_check_and_add(&seq_win, encrypted_packet_get_sender_id(&encrypted_packet), encrypted_packet_get_seq_nr(&encrypted_packet)); if(result > 0) { log_printf(WARNING, "detected replay attack, discarding packet"); continue; -- cgit v1.2.3