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 | 942010da6b24ca626750783ba18dd8b2c10d9326 (patch) | |
tree | 272988d7c1b5def10273c552af877703f17f0ecd | |
parent | 30e49ad9bd81e183d00c3c4e16d2c16f164121e3 (diff) | |
download | pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.tar pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.tar.gz pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.tar.bz2 pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.tar.lz pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.tar.xz pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.tar.zst pttbbs-942010da6b24ca626750783ba18dd8b2c10d9326.zip |
fix memory leak
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@620 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/board.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index c63dc3b8..cf6b0769 100644 --- a/mbbsd/board.c +++ b/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 |