Switch from calloc() to malloc()+memset() to match the practices used
almost everywhere else.
This commit is contained in:
+2
-1
@@ -149,9 +149,10 @@ tcp_dump_flags ( struct tcp_connection *conn, unsigned int flags ) {
|
||||
static struct tcp_connection * alloc_tcp ( void ) {
|
||||
struct tcp_connection *conn;
|
||||
|
||||
conn = calloc ( 1, sizeof ( *conn ) );
|
||||
conn = malloc ( sizeof ( *conn ) );
|
||||
if ( conn ) {
|
||||
DBGC ( conn, "TCP %p allocated\n", conn );
|
||||
memset ( conn, 0, sizeof ( *conn ) );
|
||||
conn->tcp_state = conn->prev_tcp_state = TCP_CLOSED;
|
||||
conn->snd_seq = random();
|
||||
conn->timer.expired = tcp_expired;
|
||||
|
||||
Reference in New Issue
Block a user