From cd0256863a7082619141c4806f211be7cffb3bb4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Mon, 15 Feb 2010 15:30:16 +0000 Subject: [PATCH] Close a memory leak without any consequences --- log.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/log.c b/log.c index bb39900..e051e9d 100644 --- a/log.c +++ b/log.c @@ -29,7 +29,7 @@ #define REPORT_EVERY_X_LINES 5000 -char *userfile; +static char *userfile=NULL; numlist weekdays = { { 0, 1, 2, 3, 4, 5, 6 }, 7 }; numlist hours = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -1518,8 +1518,9 @@ int main(int argc,char *argv[]) fclose(fp_denied); if(fp_authfail) fclose(fp_authfail); -// if(userfile) -//// free(userfile); + if(userfile) + free(userfile); + close_usertab(); unlink(tmp4); unlink(tmp6); unlink(tmp3); @@ -1537,6 +1538,7 @@ int main(int argc,char *argv[]) fclose(fp_authfail); if(userfile) free(userfile); + close_usertab(); exit(0); } @@ -1628,6 +1630,7 @@ int main(int argc,char *argv[]) if(userfile) free(userfile); + close_usertab(); if(debug) debuga("%s",text[21]); -- 2.47.2