Fix 75b6051b: removing items from the ini could leave the group in a bad state (#9445)

pull/332/head
Patric Stout 3 years ago committed by GitHub
parent 460991ecf4
commit ab601115a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -112,8 +112,9 @@ void IniGroup::RemoveItem(const std::string &name)
if (item->name != name) continue;
*prev = item->next;
if (this->last_item == &this->item) {
this->last_item = &item->next;
/* "last_item" is a pointer to the "real-last-item"->next. */
if (this->last_item == &item->next) {
this->last_item = prev;
}
item->next = nullptr;

Loading…
Cancel
Save