fix: correct memory cleanup index in uv_os_environ error path

This commit is contained in:
ambuj vashistha 2025-12-04 22:51:20 +05:30
parent d7dda9edfe
commit 106e4db73a
2 changed files with 2 additions and 2 deletions

View File

@ -1533,7 +1533,7 @@ int uv_os_environ(uv_env_item_t** envitems, int* count) {
fail:
for (i = 0; i < cnt; i++) {
envitem = &(*envitems)[cnt];
envitem = &(*envitems)[i];
uv__free(envitem->name);
}
uv__free(*envitems);

View File

@ -1280,7 +1280,7 @@ fail:
FreeEnvironmentStringsW(env);
for (i = 0; i < cnt; i++) {
envitem = &(*envitems)[cnt];
envitem = &(*envitems)[i];
uv__free(envitem->name);
}
uv__free(*envitems);