Memory leak in HookSystem.cpp #10783
Replies: 1 comment
-
manual memory management as usual comes to bite me in the Promoted #10790 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
HookSystem.cpp:185-250:
free()
called on a null pointerCurrent problem
The code first sets the pointer
m_originalBytes
tonullptr
(making it a null pointer). Then, it callsfree()
on this null pointer. While callingfree()
on a null pointer is technically safe (as it does nothing), the logical order is incorrect. The original memory address stored inm_originalBytes
is lost before the attempt to free it, creating a memory leak.Fix
Beta Was this translation helpful? Give feedback.
All reactions