Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortheanarkh <theratliter@gmail.com>2022-08-30 21:33:40 +0300
committerGitHub <noreply@github.com>2022-08-30 21:33:40 +0300
commit63aba5672c26dedda546a19430ff06756e87e870 (patch)
tree08328b82b1caf3c8a8a607410d32a745b6954189 /src
parent0633e9a0b5dcbc6d3c250c9086e9386c5d5261b3 (diff)
src: fix uv_err_name memory leak
PR-URL: https://github.com/nodejs/node/pull/44421 Refs: https://github.com/nodejs/node/pull/44401 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/uv.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/uv.cc b/src/uv.cc
index 81e80711df8..a98b054a4d3 100644
--- a/src/uv.cc
+++ b/src/uv.cc
@@ -73,7 +73,8 @@ void ErrName(const FunctionCallbackInfo<Value>& args) {
int err;
if (!args[0]->Int32Value(env->context()).To(&err)) return;
CHECK_LT(err, 0);
- const char* name = uv_err_name(err);
+ char name[50];
+ uv_err_name_r(err, name, sizeof(name));
args.GetReturnValue().Set(OneByteString(env->isolate(), name));
}