summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2022-08-23 08:45:33 +0100
committerChris Liddell <chris.liddell@artifex.com>2022-08-23 09:25:56 +0100
commitfa1a910dafa767504742eca9bf82c11cdfc91f87 (patch)
treea08f0d5b47ecc0a794a4305d2d9d2160e06d3a9e
parentc43a98a5ad48b9160d0b3741fe7319f4f580e26b (diff)
downloadghostpdl-fa1a910dafa767504742eca9bf82c11cdfc91f87.tar.gz
Bug 705774: Fix (not!) a memory leak in mkromfs.c
Since mkromfs is only run as part of the build process, and the "leaked" memory isn't really leaked, the only reason to fix this is so certain sanitizers can be used without requiring CCFLAGSAUX/LDFLAGSAUX to differ from CFLAGS/LDFLAGS.
-rw-r--r--base/mkromfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/base/mkromfs.c b/base/mkromfs.c
index d46450b5d..2b9d4363d 100644
--- a/base/mkromfs.c
+++ b/base/mkromfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -2690,6 +2690,11 @@ main(int argc, char *argv[])
Xlist_head = Xlist_scan;
}
printf("Total %%rom%% structure size is %d bytes.\n", totlen);
-
+ if (splits.outname != NULL)
+ free(splits.outname);
+ if (splits.outname_formatted != NULL)
+ free(splits.outname_formatted);
+ if (splits.sizes != NULL)
+ free(splits.sizes);
return 0;
}