diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2021-03-24 13:41:57 +0800 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-29 17:25:49 -0400 |
commit | 93b8db6b6f5bc43928baea52692433e31498de20 (patch) | |
tree | fd73a44b7aa63a624ed706fc63216146992b6d1e | |
parent | 38504b6f8e08db8526621ec8f11441de6d91f9ff (diff) | |
download | haskell-93b8db6b6f5bc43928baea52692433e31498de20.tar.gz |
[linker] no munmap if either agument is invalid.
-rw-r--r-- | rts/linker/MachO.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c index f301f0a340..cdafcb1c89 100644 --- a/rts/linker/MachO.c +++ b/rts/linker/MachO.c @@ -462,7 +462,10 @@ makeGot(ObjectCode * oc) { void freeGot(ObjectCode * oc) { - munmapForLinker(oc->info->got_start, oc->info->got_size, "freeGot"); + /* sanity check */ + if(NULL != oc->info->got_start && oc->info->got_size > 0) { + munmapForLinker(oc->info->got_start, oc->info->got_size, "freeGot"); + } oc->info->got_start = NULL; oc->info->got_size = 0; } |