diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-01-17 15:47:10 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-01-17 15:47:10 +0800 |
commit | 086ef46c925a1d0d4792a24d5f34acce2e5ac3cd (patch) | |
tree | 8ee164a87fdc2822bc7a159bb461e404d7d33c24 | |
parent | 59c5821cdce432639e9216a42b74942c3b447d03 (diff) | |
download | pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.tar pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.tar.gz pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.tar.bz2 pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.tar.lz pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.tar.xz pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.tar.zst pttbbs-086ef46c925a1d0d4792a24d5f34acce2e5ac3cd.zip |
fix memory leak
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@620 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/board.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index c63dc3b8..cf6b0769 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/mbbsd/board.c @@ -1,4 +1,4 @@ -/* $Id: board.c,v 1.72 2003/01/17 07:29:01 kcwu Exp $ */ +/* $Id: board.c,v 1.73 2003/01/17 07:47:10 kcwu Exp $ */ #include "bbs.h" #define BRC_STRLEN 15 /* Length of board name */ #define BRC_MAXSIZE 24576 @@ -517,6 +517,10 @@ load_boards(char *key) load_uidofgid(class_bid, type); } brdnum = 0; + if (nbrd) { + free(nbrd); + nbrd = NULL; + } if (class_bid <= 0) { nbrd = (boardstat_t *) malloc(sizeof(boardstat_t) * numboards); for (i = 0; i < numboards; i++) { @@ -1134,6 +1138,7 @@ choose_board(int newflag) tmp = currutmp->brc_id; setutmpbid(ptr->bid); free(nbrd); + nbrd = NULL; choose_board(0); currmode = currmodetmp; /* 離開板板後就把權限拿掉喔 */ num = tmp1; @@ -1145,6 +1150,7 @@ choose_board(int newflag) } } while (ch != 'q'); free(nbrd); + nbrd = NULL; } int |