From: Alex Rousskov Date: Fri, 2 Jul 2010 00:31:42 +0000 (-0600) Subject: Do not dupe argv[0] string because it is not destroyed by changing the X-Git-Tag: SQUID_3_2_0_1~93^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc91a636a6d65daa46496236180f7ad61412739c;p=thirdparty%2Fsquid.git Do not dupe argv[0] string because it is not destroyed by changing the argv[0] pointer. --- diff --git a/src/main.cc b/src/main.cc index 058b4d2c03..892bc85038 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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(kid.name().termedBuf()); execvp(prog, argv); syslog(LOG_ALERT, "execvp failed: %s", xstrerror());