32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
![]() |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||
|
Date: Thu, 26 Jun 2025 12:46:41 +0000
|
||
|
Subject: fix: -Wmismatched-new-delete in debug_utils.cc
|
||
|
|
||
|
Fixes the following error:
|
||
|
|
||
|
Error: ../../third_party/electron_node/src/debug_utils.cc(491,11): error: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Werror,-Wmismatched-new-delete]
|
||
|
491 | delete str;
|
||
|
| ^
|
||
|
| []
|
||
|
../../third_party/electron_node/src/debug_utils.cc(487,23): note: allocated with 'new[]' here
|
||
|
487 | char* str = new char[size];
|
||
|
| ^
|
||
|
1 error generated.
|
||
|
|
||
|
Upstreamed in https://github.com/nodejs/node/pull/58844.
|
||
|
|
||
|
diff --git a/src/debug_utils.cc b/src/debug_utils.cc
|
||
|
index 97884b9a0f8d6d88e36da06b05642505c767338d..65283ef31da35d0f08fcff7a5e79bf960d861126 100644
|
||
|
--- a/src/debug_utils.cc
|
||
|
+++ b/src/debug_utils.cc
|
||
|
@@ -488,7 +488,7 @@ std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
|
||
|
WideCharToMultiByte(
|
||
|
CP_UTF8, 0, module_name, -1, str, size, nullptr, nullptr);
|
||
|
list.emplace_back(str);
|
||
|
- delete str;
|
||
|
+ delete[] str;
|
||
|
}
|
||
|
}
|
||
|
}
|