From ecacf33356514002b8ecc3350e428468c4aad82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 11 Oct 2018 17:01:17 -0700 Subject: [PATCH] src: fix bug in MallocedBuffer constructor This should be a generic type even though we are currently only using `char` as `T`. PR-URL: https://github.com/nodejs/node/pull/23434 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index b522a88b7265c5..d41255bd32cc81 100644 --- a/src/util.h +++ b/src/util.h @@ -443,7 +443,7 @@ struct MallocedBuffer { MallocedBuffer() : data(nullptr) {} explicit MallocedBuffer(size_t size) : data(Malloc(size)), size(size) {} - MallocedBuffer(char* data, size_t size) : data(data), size(size) {} + MallocedBuffer(T* data, size_t size) : data(data), size(size) {} MallocedBuffer(MallocedBuffer&& other) : data(other.data), size(other.size) { other.data = nullptr; }