]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not dupe argv[0] string because it is not destroyed by changing the
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 2 Jul 2010 00:31:42 +0000 (18:31 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 2 Jul 2010 00:31:42 +0000 (18:31 -0600)
argv[0] pointer.

src/main.cc

index 058b4d2c03f9f971785929d635fd042ce1a20e99..892bc85038183a1a02b8b9e37d5599646ecb91df 100644 (file)
@@ -1658,7 +1658,7 @@ watch_child(char *argv[])
             if ((pid = fork()) == 0) {
                 /* child */
                 openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
-                prog = xstrdup(argv[0]);    /* XXX: leak */
+                prog = argv[0];
                 argv[0] = const_cast<char*>(kid.name().termedBuf());
                 execvp(prog, argv);
                 syslog(LOG_ALERT, "execvp failed: %s", xstrerror());