]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] startup: release unused structs after forking
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Aug 2010 10:49:05 +0000 (12:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Aug 2010 10:52:29 +0000 (12:52 +0200)
Don't keep the old pid list or chroot place after startup, they won't be used anymore.

src/haproxy.c

index 85c2e3a017acd3384d9b4755ada200780d5f17b7..75a310d10799dd2f5e1ec63887b5fa27916ecfd2 100644 (file)
@@ -1200,8 +1200,11 @@ int main(int argc, char **argv)
                /* close the pidfile both in children and father */
                if (pidfile != NULL)
                        fclose(pidfile);
-               free(global.pidfile);
-               global.pidfile = NULL;
+
+               /* We won't ever use this anymore */
+               free(oldpids);        oldpids = NULL;
+               free(global.chroot);  global.chroot = NULL;
+               free(global.pidfile); global.pidfile = NULL;
 
                /* we might have to unbind some proxies from some processes */
                px = proxy;