summaryrefslogtreecommitdiffstats
path: root/mbbsd/fav.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-15 09:24:07 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-15 09:24:07 +0800
commit2b77229a09701b117abd7e64f5d6b26b81d45bd1 (patch)
tree1a41fb88b9e44fc884698cd60c9363c85310e7d8 /mbbsd/fav.c
parent000b2c262e67107024cecf2f4f87ac0a30ebde6a (diff)
downloadpttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.tar
pttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.tar.gz
pttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.tar.bz2
pttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.tar.lz
pttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.tar.xz
pttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.tar.zst
pttbbs-2b77229a09701b117abd7e64f5d6b26b81d45bd1.zip
fix memory leak, remove dirty hacking code
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1592 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/fav.c')
-rw-r--r--mbbsd/fav.c13
1 files changed, 2 insertions, 11 deletions
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));