-
-
Save bnoordhuis/21a5bca23f3a9f9aa999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/node.cc b/src/node.cc | |
index f6ae19d..04ff7d1 100644 | |
--- a/src/node.cc | |
+++ b/src/node.cc | |
@@ -1887,7 +1887,7 @@ static Handle<Value> EnvSetter(Local<String> property, | |
String::Utf8Value val(value); | |
#ifdef __POSIX__ | |
- setenv(*key, *val, 1); | |
+ if (setenv(*key, *val, 1)) return Undefined(); | |
#else // __WIN32__ | |
int n = key.length() + val.length() + 2; | |
char* pair = new char[n]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment