Browse code

fix "leak". It was a valgrind false-positive because it couldn't see the pointer.

git-svn: trunk@4402

Török Edvin authored on 2008/11/14 01:11:13
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Thu Nov 13 17:12:40 EET 2008 (edwin)
2
+------------------------------------
3
+ * clamd/clamd.c: fix leak. It was a valgrind false-positive because
4
+ it couldn't see the pointer.
5
+
1 6
 Thu Nov 13 16:59:47 EET 2008 (edwin)
2 7
 ------------------------------------
3 8
  * unit_tests/Makefile.am, unit_tests/Makefile.in: fix paths
... ...
@@ -89,6 +89,9 @@ static void help(void)
89 89
 }
90 90
 
91 91
 static struct cfgstruct *copt;
92
+/* needs to be global, so that valgrind reports it as reachable, and not
93
+ * as definetely/indirectly lost when daemonizing clamd */
94
+static struct cl_engine *engine;
92 95
 int main(int argc, char **argv)
93 96
 {
94 97
 	const struct cfgstruct *cpt;
... ...
@@ -96,7 +99,6 @@ int main(int argc, char **argv)
96 96
         struct passwd *user = NULL;
97 97
 #endif
98 98
 	time_t currtime;
99
-	struct cl_engine *engine;
100 99
 	const char *dbdir, *cfgfile;
101 100
 	char *pua_cats = NULL;
102 101
 	int ret, tcpsock = 0, localsock = 0, i;