aboutsummaryrefslogtreecommitdiff
path: root/subhook_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'subhook_unix.c')
-rw-r--r--subhook_unix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/subhook_unix.c b/subhook_unix.c
index 48c6af2..d3616d7 100644
--- a/subhook_unix.c
+++ b/subhook_unix.c
@@ -52,5 +52,8 @@ void *subhook_alloc_code(size_t size) {
}
int subhok_free_code(void *address, size_t size) {
+ if (address == NULL) {
+ return 0;
+ }
return munmap(address, size);
}