current miscutil.c,1.81,1.82

Lee <[email protected]> Sat, 23 Jul 2016 23:05:18 +0000
Newsgroups gmane.comp.web.privoxy.cvs
Message-ID <[email protected]>
Update of /cvsroot/ijbswa/current
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12577/current

Modified Files:
	miscutil.c 
Log Message:
so the next person doesn't waste any time wondering why
it's only on Windows that the memory gets freed



Index: miscutil.c
===================================================================
RCS file: /cvsroot/ijbswa/current/miscutil.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** miscutil.c	26 Feb 2016 12:29:17 -0000	1.81
--- miscutil.c	23 Jul 2016 23:05:15 -0000	1.82
***************
*** 894,897 ****
--- 894,907 ----
           putenv(old_zone);
  #ifdef _WIN32
+          /* http://man7.org/linux/man-pages/man3/putenv.3.html
+           *   int putenv(char *string);
+           *     The string pointed to by string becomes part of the environment, so altering the
+           *     string changes the environment.
+           * In other words, the memory pointed to by *string is used until
+           *   a) another call to putenv() with the same e-var name
+           *   b) the program exits
+           *
+           * Windows e-vars don't work that way, so let's not leak memory.
+           */
           free(old_zone);
  #endif /* def _WIN32 */


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev