<div dir="ltr">In the KvpValue::Type::FRAME case if the guid matches, it does both:<br>            delete inst->kvp_data->set_path({path}, nullptr);<br>            delete v;<br>Where earlier the v was set to be:<br>    auto v = inst->kvp_data->get_slot({path});<br>I think the second delete is a duplicate of the first and should be removed.<br><br>I found it by getting a strange warning and then a crash on that second delete. I verified that it calls the frame destructor on the same object twice. It is not surprising that double delete causes strange behavior, but I did not verify the exact problem.<br><br>The test case that crashed was:<br>    auto gncGuid1 = guid_new();<br>    qof_instance_kvp_add_guid(m_inst, "guid", 123u, "mytime", gncGuid1);<br>    qof_instance_kvp_remove_guid(m_inst, "guid", "mytime", gncGuid1);<br><br><br>This functionality is used in Split.cpp in support of xaccScrubMergeLotSubSplits().  Where and why that is used, I am not sure, but it is likely to be a problem under circumstances where the code is actually called. I'm not sure if this is common, or even possible use case.<br><br>I think the following will fix this issue:<br>modified   libgnucash/engine/qofinstance.cpp<br>@@ -1216,7 +1216,6 @@ qof_instance_kvp_remove_guid (const QofInstance *inst, const char *path,<br>         if (kvp_match_guid (v, {key}, guid))<br>         {<br>             delete inst->kvp_data->set_path({path}, nullptr);<br>-            delete v;<br>         }<br>         break;<br>     case KvpValue::Type::GLIST:<br><br><br>Since I am new, I wanted to get confirmation, that I am not missing something.<br><br>If the change is good, I will add it (as a separate commit) to my next testing merge request.  That is what we agreed to on the previous, less serious, issue I found.<br><div><br></div><div>Stefan</div></div>