#2122 closed defect (fixed)
[PATCH]Small possible memory leak in network/fsm.cpp
Reported by: | Riemer | Owned by: | ben |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 15 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
In the function CFsm::AddTransition the pointer to pEvent is lost when allocating pNewTransition fails. Although I doubt the leak will cause a problem when it occurs (the non-allocating will probably cause more havoc), it is atleast something I found after a day worth of digging.
ps. I must add, this is quite a nice codebase! Really educational
Affected sourefile: source/network/fsm.cpp
note: this is based on the git repo
Attachments (1)
Change History (6)
by , 11 years ago
Attachment: | save.patch added |
---|
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
Keywords: | review patch added |
---|---|
Summary: | Small possible memory leak in network/fsm.cpp → [PATCH]Small possible memory leak in network/fsm.cpp |
comment:3 by , 11 years ago
I think CppCheck or similar report this issue, and it could certainly be a memory leak. I don't know if anyone has ever hit that code path, as you say the leak would be the least problem, but freeing it is technically the correct thing to do.
comment:5 by , 11 years ago
Keywords: | review removed |
---|
Patch file, apply in root of 0ad