From a83cd092223f8efd9cd6bd8cd3d02134ad26c372 Mon Sep 17 00:00:00 2001 From: kcwu Date: Wed, 22 Mar 2006 17:58:41 +0000 Subject: assert for fav_malloc size. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3297 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/fav.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 6e1398a9..a1f2336a 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -254,7 +254,9 @@ static int get_type_size(int type) } inline static void* fav_malloc(int size){ - void *p = (void *)malloc(size); + void *p; + assert(size>0); + p = (void *)malloc(size); assert(p); memset(p, 0, size); return p; -- cgit v1.2.3