]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Close a memory leak without any consequences
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 15 Feb 2010 15:30:16 +0000 (15:30 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 15 Feb 2010 15:30:16 +0000 (15:30 +0000)
log.c

diff --git a/log.c b/log.c
index bb399007f8b0b895a091f6a47697c420e276fc5e..e051e9d2277d3dd208deda10d2c256715d2a6bff 100644 (file)
--- 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]);