summaryrefslogtreecommitdiffstats
path: root/mbbsd/read.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-09 20:04:00 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-09 20:04:00 +0800
commitb9f232fd155fd9c8bf6428d49dfdd392bcc6779e (patch)
treef79769bc75ada057d4cd3a335d4732b2ac65d2e9 /mbbsd/read.c
parentccd9c81ff6d7365eb4c11f7b881ae6c00a037d58 (diff)
downloadpttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.tar
pttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.tar.gz
pttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.tar.bz2
pttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.tar.lz
pttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.tar.xz
pttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.tar.zst
pttbbs-b9f232fd155fd9c8bf6428d49dfdd392bcc6779e.zip
add some assert() on malloc()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1582 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/read.c')
-rw-r--r--mbbsd/read.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 537a1921..1c2e5de1 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -198,7 +198,9 @@ getkeep(char *s, int def_topline, int def_cursline)
else
def_cursline = -def_cursline;
p = (keeploc_t *) malloc(sizeof(keeploc_t));
+ assert(p);
p->key = (char *)malloc(strlen(s) + 1);
+ assert(p->key);
strcpy(p->key, s);
p->top_ln = def_topline;
p->crs_ln = def_cursline;