summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2022-01-27 23:08:26 -0500
committerGHC GitLab CI <ghc-ci@gitlab-haskell.org>2022-01-27 23:08:26 -0500
commit6cfb5a4329a8e46475069249d1f4b962bda3bfee (patch)
tree56b560816f1301507ba5309ba2a8b3d21de9d6e2
parent6e712f7c6e1661a79e76482a11d2bb26954b3fe9 (diff)
downloadhaskell-6cfb5a4329a8e46475069249d1f4b962bda3bfee.tar.gz
rts/PEi386: Fix memory leak
-rw-r--r--rts/linker/PEi386.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index a339371fb0..82f77bdb0f 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -1337,7 +1337,9 @@ ocVerifyImage_PEi386 ( ObjectCode* oc )
}
/* Initialize the last section's info field which contains the .bss
- section, it doesn't need an info so set it to NULL. */
+ section, the .info of which will be initialized by ocGetNames. Discard the
+ .info that we computed above. */
+ stgFree(sections[info->numberOfSections].info);
sections[info->numberOfSections].info = NULL;
/* Calculate space for trampolines nearby.