We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
userInfo()
1 parent cc65fee commit 3e512f1Copy full SHA for 3e512f1
src/node_os.cc
@@ -368,6 +368,8 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
368
return args.GetReturnValue().SetUndefined();
369
}
370
371
+ OnScopeLeave free_passwd([&]() { uv_os_free_passwd(&pwd); });
372
+
373
Local<Value> error;
374
375
Local<Value> uid = Number::New(env->isolate(), pwd.uid);
@@ -389,7 +391,6 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
389
391
390
392
if (username.IsEmpty() || homedir.IsEmpty() || shell.IsEmpty()) {
393
CHECK(!error.IsEmpty());
- uv_os_free_passwd(&pwd);
394
env->isolate()->ThrowException(error);
395
return;
396
0 commit comments