diff --git a/overlay_buffer.c b/overlay_buffer.c index 1db3496b..cf66daeb 100644 --- a/overlay_buffer.c +++ b/overlay_buffer.c @@ -353,13 +353,13 @@ int ob_dump(overlay_buffer *b,char *desc) void *_serval_debug_malloc(unsigned int bytes,char *file,const char *func,int line) { void *r=malloc(bytes+SDM_GUARD_AFTER); - fprintf(stderr,"%s:%d:%s(): malloc(%d) -> %p\n",file,line,func,bytes,r); + fprintf(stderr,"%s:%d:%s(): malloc(%d) -> %p\n",file,line,func,bytes,r); return r; } void *_serval_debug_calloc(unsigned int bytes,unsigned int count,char *file,const char *func,int line) { - void *r=calloc(bytes+SDM_GUARD_AFTER,count); + void *r=calloc((bytes*count)+SDM_GUARD_AFTER,1); fprintf(stderr,"%s:%d:%s(): calloc(%d,%d) -> %p\n",file,line,func,bytes,count,r); return r; }