mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-22 01:17:04 +00:00
Fix order of arguments in calls to calloc
This commit is contained in:
parent
e82f01e3fb
commit
2e0d67c172
8 changed files with 9 additions and 9 deletions
|
@ -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));
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue