summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-23 01:58:41 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-23 01:58:41 +0800
commita83cd092223f8efd9cd6bd8cd3d02134ad26c372 (patch)
tree1e022658473c69879e9421c8661fbf197cb406ba /mbbsd
parent8f19c634c937b71e67d3b5a580091882a02bf6cb (diff)
downloadpttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.tar
pttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.tar.gz
pttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.tar.bz2
pttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.tar.lz
pttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.tar.xz
pttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.tar.zst
pttbbs-a83cd092223f8efd9cd6bd8cd3d02134ad26c372.zip
assert for fav_malloc size.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3297 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/fav.c4
1 files changed, 3 insertions, 1 deletions
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;