summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2022-01-27 23:08:26 -0500
committerBen Gamari <ben@smart-cactus.org>2022-04-06 16:25:04 -0400
commit42bf7528559fb518092fef3902afb73af5de146e (patch)
tree64d37833a3dfd0d7c66edd54f6389a4a68b7747e
parent9eb0a9d96942a3d17e5e2e02b5cd44c3ac513158 (diff)
downloadhaskell-42bf7528559fb518092fef3902afb73af5de146e.tar.gz
rts/PEi386: Fix memory leak
Previously we would leak the section information of the `.bss` section.
-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 df0cdfab52..67cf049a62 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -1228,7 +1228,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.