From: Frédéric Marchal Date: Mon, 15 Feb 2010 15:30:16 +0000 (+0000) Subject: Close a memory leak without any consequences X-Git-Tag: v2.3-pre2~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd0256863a7082619141c4806f211be7cffb3bb4;p=thirdparty%2Fsarg.git Close a memory leak without any consequences --- 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]);