From: Willy Tarreau Date: Wed, 25 Aug 2010 10:49:05 +0000 (+0200) Subject: [MINOR] startup: release unused structs after forking X-Git-Tag: v1.5-dev8~485 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d137dd3151f6c968ce4f0cdb9c9f16c72e40f180;p=thirdparty%2Fhaproxy.git [MINOR] startup: release unused structs after forking Don't keep the old pid list or chroot place after startup, they won't be used anymore. --- diff --git a/src/haproxy.c b/src/haproxy.c index 85c2e3a017..75a310d107 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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;