Skip to content

Commit bb68b31

Browse files
vadzz-devOlegT
authored and
OlegT
committed
Fix buffer leak in emitClientRaw
1 parent 1af11d3 commit bb68b31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shared/helpers/Serialization.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,10 @@ alt::MValueByteArray V8Helpers::V8ToRawBytes(v8::Local<v8::Value> val)
528528
if(!serializer.WriteValue(ctx, val).To(&result) || !result) return alt::MValueByteArray();
529529

530530
std::pair<uint8_t*, size_t> serialized = serializer.Release();
531-
return alt::ICore::Instance().CreateMValueByteArray(serialized.first, serialized.second);
531+
auto mvArray = alt::ICore::Instance().CreateMValueByteArray(serialized.first, serialized.second);
532+
533+
delegate.FreeBufferMemory(serialized.first);
534+
return mvArray;
532535
}
533536

534537
// Converts a MValue byte array to a JS value

0 commit comments

Comments
 (0)