diff options
author | Zeex <zeex@rocketmail.com> | 2020-11-02 03:46:00 +0600 |
---|---|---|
committer | Zeex <zeex@rocketmail.com> | 2020-11-02 03:46:00 +0600 |
commit | a596f2b117fe06540da3903c9a60e9d7882af6da (patch) | |
tree | 123ae872831a22d421c3e15f658efdc15f8ef35c /subhook_windows.c | |
parent | 846deef5a85c700cdd3ea10b51622ed5084feb6a (diff) | |
download | subhook-a596f2b117fe06540da3903c9a60e9d7882af6da.zip subhook-a596f2b117fe06540da3903c9a60e9d7882af6da.tar.gz subhook-a596f2b117fe06540da3903c9a60e9d7882af6da.tar.bz2 |
Add null check in subhok_free_code()
Diffstat (limited to 'subhook_windows.c')
-rw-r--r-- | subhook_windows.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/subhook_windows.c b/subhook_windows.c index b934651..bf6d2e9 100644 --- a/subhook_windows.c +++ b/subhook_windows.c @@ -47,5 +47,9 @@ void *subhook_alloc_code(size_t size) { int subhok_free_code(void *address, size_t size) { (void)size; + + if (address == NULL) { + return 0; + } return !VirtualFree(address, 0, MEM_RELEASE); } |