summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2016-06-01 15:53:01 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2016-06-02 09:21:24 +0200
commit3a3996315c39b377d19db03434acf27d1d83cb98 (patch)
tree6f23ff35b777da781cd7bb21eb4f1c4e046d9223 /src
parent3549a5e4fff3f0c2f52bb01daae86e64576417e1 (diff)
downloadandroid-node-v8-3a3996315c39b377d19db03434acf27d1d83cb98.tar.gz
android-node-v8-3a3996315c39b377d19db03434acf27d1d83cb98.tar.bz2
android-node-v8-3a3996315c39b377d19db03434acf27d1d83cb98.zip
lib,src: reset zero fill flag on exception
Exceptions thrown from the Uint8Array constructor would leave it disabled. Regression introduced in commit 27e84dd ("lib,src: clean up ArrayBufferAllocator") from two days ago. A follow-up commit will add a regression test. PR-URL: https://github.com/nodejs/node/pull/7093 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node.cc b/src/node.cc
index 3c508183c9..10d67a02fc 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -973,8 +973,8 @@ Local<Value> WinapiErrnoException(Isolate* isolate,
void* ArrayBufferAllocator::Allocate(size_t size) {
if (zero_fill_field_ || zero_fill_all_buffers)
return calloc(size, 1);
- zero_fill_field_ = 1;
- return malloc(size);
+ else
+ return malloc(size);
}
static bool DomainHasErrorHandler(const Environment* env,