Fix: Memory leak writing to builtin attribute with wrong type
The store named attribute node creates a new buffer to evaluate the field into. When creating the attribute with that buffer fails, if must be freed.
This commit is contained in:
@@ -118,7 +118,9 @@ static void try_capture_field_on_geometry(GeometryComponent &component,
|
||||
MEM_freeN(buffer);
|
||||
}
|
||||
else {
|
||||
component.attribute_try_create(name, domain, data_type, AttributeInitMove{buffer});
|
||||
if (!component.attribute_try_create(name, domain, data_type, AttributeInitMove{buffer})) {
|
||||
MEM_freeN(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user