mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
JSON: Fix memory leak in parser
- Fix JSON root object leaking out by using delete. This is by no means a comprehensive fix since exceptions are involved in a lot of places, but it does fix the memory leak in all cases checked in Taskwarrior's test suite. - Going with a shared_ptr or unique_ptr here might be a better solution, but would involve more code changes.
This commit is contained in:
parent
5f8469269e
commit
2ad3713e8c
2 changed files with 6 additions and 0 deletions
|
@ -706,6 +706,8 @@ void Task::parseJSON (const std::string& line)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete root;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue