}
}
+#if _MSC_VER >= 1300
+ /* VS.Net has a bug in putenv() when setting a variable that
+ * is already set; if the SetEnvironmentVariable() API call
+ * fails, the Crt will double free() a string.
+ * We try to avoid this by setting our own value first */
+ SetEnvironmentVariable(pe.key, "bugbug");
+#endif
+
if (putenv(pe.putenv_string) == 0) { /* success */
zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len+1, (void **) &pe, sizeof(putenv_entry), NULL);
#ifdef HAVE_TZSET