Files
znc/src
Wolf480pl 80f9baf0a6 Fix memory leak and null dereference in CZNC::LoadUsers
Before this commit, when pUser->SetBeingDeleted(true) is executed,
pUser is an empty unique_ptr, because release() was already called
on it. Therefore, pUser->SetBeingDeleted is unidefined behaviour.

Also, AddUser only takes ownership of the passed user pointer if it
succeeds. In case of a failure, it's the caller's responsibility to
delete the user.

Fix this by keeping a raw pointer to the user, and handling it
accordingly when AddUser fails.

I have no idea whether SetBeingDeleted is necessary there, leaving it
just in case.

Maybe it would be better if we could change the semantics of
AddUser to always take ownership of the pointer,
or even take unique_ptr, but I have no idea how to adapt Python
bindings in modpython to such change.
2018-07-25 17:25:38 +02:00
..
2018-01-19 19:38:58 +00:00
2018-03-25 22:57:05 +01:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00
2015-12-07 00:53:30 +00:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00
2015-12-07 00:53:30 +00:00
2018-04-01 12:06:29 +01:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00
2018-06-10 21:09:07 +01:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00
2018-01-19 19:38:58 +00:00