mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Fix use-after-free in node meta cleanup
bug introduced in 8908a9101608d3343023b470743ef63f1c44b0b7
This commit is contained in:
parent
a9a207685a
commit
9fc018ded1
@ -66,8 +66,10 @@ void NodeMetaRef::reportMetadataChange(const std::string *name)
|
||||
NodeMetadata *meta = dynamic_cast<NodeMetadata*>(getmeta(false));
|
||||
|
||||
// If the metadata is now empty, get rid of it
|
||||
if (meta && meta->empty())
|
||||
if (meta && meta->empty()) {
|
||||
clearMeta();
|
||||
meta = nullptr;
|
||||
}
|
||||
|
||||
MapEditEvent event;
|
||||
event.type = MEET_BLOCK_NODE_METADATA_CHANGED;
|
||||
|
Loading…
Reference in New Issue
Block a user