Fix order of arguments in calls to calloc

This commit is contained in:
William Robinet 2015-05-18 15:40:22 +02:00
parent e82f01e3fb
commit 2e0d67c172
8 changed files with 9 additions and 9 deletions

View file

@ -153,7 +153,7 @@ int packet_copy(in,out)
packet *p=0;
if(!(p=(packet *)calloc(sizeof(packet),1)))
if(!(p=(packet *)calloc(1,sizeof(packet))))
ABORT(R_NO_MEMORY);
memcpy(&p->ts,&in->ts,sizeof(struct timeval));

View file

@ -58,7 +58,7 @@ int create_proto_handler(mod,ctx,handlerp,conn,first_packet)
int r,_status;
proto_handler *handler=0;
if(!(handler=(proto_handler *)calloc(sizeof(proto_handler),1)))
if(!(handler=(proto_handler *)calloc(1,sizeof(proto_handler))))
ABORT(R_NO_MEMORY);
handler->vtbl=mod->vtbl;
if(r=mod->vtbl->create(mod->handle,ctx,conn,&handler->obj,

View file

@ -222,7 +222,7 @@ int copy_tcp_segment_queue(out,in)
segment *base=0;
for(;in;in=in->next){
if(!(*out=(segment *)calloc(sizeof(segment),1)))
if(!(*out=(segment *)calloc(1,sizeof(segment))))
ABORT(R_NO_MEMORY);
if(!base) base=*out;

View file

@ -283,7 +283,7 @@ static int process_data_segment(conn,handler,p,stream,direction)
break;
}
if(!(nseg=(segment *)calloc(sizeof(segment),1)))
if(!(nseg=(segment *)calloc(1,sizeof(segment))))
ABORT(R_NO_MEMORY);
if(r=packet_copy(p,&nseg->p))
ABORT(r);

View file

@ -75,7 +75,7 @@ static int create_null_analyzer(handle,ctx,conn,objp,i_addr,i_port,r_addr,r_port
null_analyzer *obj=0;
static int ctr;
if(!(obj=(null_analyzer *)calloc(sizeof(null_analyzer),1)))
if(!(obj=(null_analyzer *)calloc(1,sizeof(null_analyzer))))
ERETURN(R_NO_MEMORY);
obj->num=ctr++;

View file

@ -241,7 +241,7 @@ static int create_ssl_analyzer(handle,ctx,conn,objp,i_addr,i_port,r_addr,r_port,
int r,_status;
ssl_obj *obj=0;
if(!(obj=(ssl_obj *)calloc(sizeof(ssl_obj),1)))
if(!(obj=(ssl_obj *)calloc(1,sizeof(ssl_obj))))
ABORT(R_NO_MEMORY);
obj->ssl_ctx=(ssl_decode_ctx *)ctx;
@ -314,7 +314,7 @@ static int create_r_queue(qp)
r_queue *q=0;
int _status;
if(!(q=(r_queue *)calloc(sizeof(r_queue),1)))
if(!(q=(r_queue *)calloc(1,sizeof(r_queue))))
ABORT(R_NO_MEMORY);
if(!(q->data=(UCHAR *)malloc(SSL_HEADER_SIZE)))

View file

@ -119,7 +119,7 @@ int ssl_create_rec_decoder(dp,cs,mk,sk,iv)
ciph=EVP_enc_null();
}
if(!(dec=(ssl_rec_decoder *)calloc(sizeof(ssl_rec_decoder),1)))
if(!(dec=(ssl_rec_decoder *)calloc(1,sizeof(ssl_rec_decoder))))
ABORT(R_NO_MEMORY);
dec->cs=cs;

View file

@ -185,7 +185,7 @@ int ssl_decoder_create(dp,ctx)
ssl_decoder *d=0;
#ifdef OPENSSL
if(!(d=(ssl_decoder *)calloc(sizeof(ssl_decoder),1)))
if(!(d=(ssl_decoder *)calloc(1,sizeof(ssl_decoder))))
ABORT(R_NO_MEMORY);
d->ctx=ctx;