diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-01-17 15:59:35 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-01-17 15:59:35 +0800 |
commit | 7b6c05d74dc34dd6b61e07eb314048cdddc292f0 (patch) | |
tree | 0bae1cdd948e655d74e9be303070e69d21378d89 /mbbsd | |
parent | 942010da6b24ca626750783ba18dd8b2c10d9326 (diff) | |
download | pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.tar pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.tar.gz pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.tar.bz2 pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.tar.lz pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.tar.xz pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.tar.zst pttbbs-7b6c05d74dc34dd6b61e07eb314048cdddc292f0.zip |
fix memory leak
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@621 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/guess.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mbbsd/guess.c b/mbbsd/guess.c index 539388e2..ece753b4 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -1,4 +1,4 @@ -/* $Id: guess.c,v 1.11 2003/01/16 14:37:32 kcwu Exp $ */ +/* $Id: guess.c,v 1.12 2003/01/17 07:59:35 kcwu Exp $ */ #include "bbs.h" #define LOGPASS BBSHOME "/etc/winguess.log" @@ -286,9 +286,9 @@ guess_main() } } move(17, 35); + free(flag); + free(n); if (ifcomputer[0]) { - free(flag); - free(n); if (count > c_count) { prints("你輸給電腦了"); move(18, 35); @@ -302,9 +302,6 @@ guess_main() fprintf(file, "電腦賺走了%s %ld Ptt$\n", cuser.userid, money); fclose(file); } - unlockutmpmode(); - pressanykey(); - return 1; } else if (count < c_count) { prints("真厲害, 讓你賺到囉"); move(18, 35); @@ -316,9 +313,6 @@ guess_main() c_count, money * 2); fclose(file); } - unlockutmpmode(); - pressanykey(); - return 1; } else { prints("真厲害, 和電腦打成平手了, 拿回本錢%lu\n", money); demoney(money); @@ -326,10 +320,10 @@ guess_main() fprintf(file, "id: %s 和電腦打成了平手\n", cuser.userid); fclose(file); } - unlockutmpmode(); - pressanykey(); - return 1; } + unlockutmpmode(); + pressanykey(); + return 1; } if (youwin) { demoney(TABLE[count] * money); |