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