Commit 36cc0ee9 authored by Yash Ladha's avatar Yash Ladha Committed by Rich Trott
Browse files

src: use make_shared for safe allocation

Using the reset does a double allocation and is error prone if some
exception occured which is very unlikely but can happen. make_shared_ptr
gives hedge over this and handle the failure in allocation.

PR-URL: https://github.com/nodejs/node/pull/37139


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 5ef4c64e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment