summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index c841c6e789..aec4e30d31 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -1027,6 +1027,12 @@ SAPI_API char *sapi_getenv(char *name, size_t name_len)
char *value, *tmp = sapi_module.getenv(name, name_len);
if (tmp) {
value = estrdup(tmp);
+#ifdef PHP_WIN32
+ if (strlen(sapi_module.name) == sizeof("cgi-fcgi") - 1 && !strcmp(sapi_module.name, "cgi-fcgi")) {
+ /* XXX more modules to go, if needed. */
+ free(tmp);
+ }
+#endif
} else {
return NULL;
}