mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Fix memory leak in hash.update()
This commit is contained in:
1 parent
009b4569b3
commit
d6072766ed
1 file changed
+5
-4
+5
-4
@@ -2048,12 +2048,11 @@ class Hash : public ObjectWrap {
|
||||
return args.This();
|
||||
}
|
||||
|
||||
static Handle<Value>
|
||||
HashUpdate(const Arguments& args) {
|
||||
Hash *hash = ObjectWrap::Unwrap<Hash>(args.This());
|
||||
|
||||
static Handle<Value> HashUpdate(const Arguments& args) {
|
||||
HandleScope scope;
|
||||
|
||||
Hash *hash = ObjectWrap::Unwrap<Hash>(args.This());
|
||||
|
||||
enum encoding enc = ParseEncoding(args[1]);
|
||||
ssize_t len = DecodeBytes(args[0], enc);
|
||||
|
||||
@@ -2068,6 +2067,8 @@ class Hash : public ObjectWrap {
|
||||
|
||||
int r = hash->HashUpdate(buf, len);
|
||||
|
||||
delete[] buf;
|
||||
|
||||
return args.This();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user