From 2b77229a09701b117abd7e64f5d6b26b81d45bd1 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 15 Mar 2004 01:24:07 +0000 Subject: fix memory leak, remove dirty hacking code git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1592 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/board.c | 2 +- mbbsd/fav.c | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/board.c b/mbbsd/board.c index 6d766ff3..e7658328 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1244,7 +1244,7 @@ choose_board(int newflag) } Copy(buf, fname); fav_free(); - load_brdbuf(); + fav_load(); break; } brdnum = -1; diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 3260230a..b26993ab 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -455,15 +455,6 @@ int fav_save(void) return -1; write_favrec(fd, fp); close(fd); - - /* dirty hack, i hope will find out the reasion */ - if (dashs(buf) == 0) { - FILE *dirty = fopen("dirtyhack.check", "a"); - fprintf(dirty, "[%s] fp:%x datatail:%d - %s", cuser.userid, (int)fp, fp->DataTail, ctime(&now)); - fclose(dirty); - return -1; - } - Rename(buf, buf2); return 0; } @@ -967,8 +958,6 @@ int fav_v3_to_v4(void) if (!dashf(buf)) return -1; - fav4 = (fav_t *)fav_malloc(sizeof(fav_t)); - setuserfile(buf, FAV4); if (dashf(buf)) return 0; @@ -982,6 +971,8 @@ int fav_v3_to_v4(void) return -1; } + fav4 = (fav_t *)fav_malloc(sizeof(fav_t)); + read(fd, &nDatas, sizeof(nDatas)); read(fd, &nLines, sizeof(nLines)); -- cgit v1.2.3