Initialize the fourth and final instance variable of MemoryProxy

The constructor of MemoryProxy initializes 3 of 4 instances variables.
If a MemoryProxy is constructed and MemoryProxy::free is called
on this instance, buffer_ is undefined and 'delete buffer_;' causes errors.

Although this misuse pattern does not exist in the current codebase
it already tripped up the Address Sanitizer on various occasions
while debugging unrelated problems.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D13569
This commit is contained in:
Michael 2021-12-15 15:45:50 +01:00 committed by Jeroen Bakker
parent 1a833dbdb9
commit 5f52684a0f
1 changed files with 1 additions and 0 deletions

View File

@ -25,6 +25,7 @@ MemoryProxy::MemoryProxy(DataType datatype)
{
write_buffer_operation_ = nullptr;
executor_ = nullptr;
buffer_ = nullptr;
datatype_ = datatype;
}