summaryrefslogtreecommitdiff
path: root/psi/imain.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-09-05 18:07:40 +0100
committerRobin Watts <robin.watts@artifex.com>2018-09-05 19:20:15 +0100
commit2b533271d8bd915593a2f8e1a1f446ee940c7d76 (patch)
treeb15eb5abb50cdf3072fae00c098dab0b70b3b2fd /psi/imain.c
parenta8c7899267121cb92503fe0f7e7f6ae433c386b1 (diff)
downloadghostpdl-2b533271d8bd915593a2f8e1a1f446ee940c7d76.tar.gz
Fix arg_copy leaks.
When handling -d or -s args, the code currently arg_copies the string it gets back, then uses that copied block to make postscript names from. Here we change the code so that postscript names are made in a slightly different way, so they copy the string content. This means we can free the arg_copied block afterwards, solving the leaks. While we are here, remove a layer of nasty variable hiding macros that do nothing but confuse things.
Diffstat (limited to 'psi/imain.c')
-rw-r--r--psi/imain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/psi/imain.c b/psi/imain.c
index 138bfc82b..9fc72bb10 100644
--- a/psi/imain.c
+++ b/psi/imain.c
@@ -264,18 +264,18 @@ int gs_main_init2aux(gs_main_instance * minst) {
/* Set up the array of additional initialization files. */
make_const_string(&ifa, a_readonly | avm_foreign, gs_init_files_sizeof - 2, gs_init_files);
- code = initial_enter_name("INITFILES", &ifa);
+ code = i_initial_enter_name(i_ctx_p, "INITFILES", &ifa);
if (code < 0)
return code;
/* Set up the array of emulator names. */
make_const_string(&ifa, a_readonly | avm_foreign, gs_emulators_sizeof - 2, gs_emulators);
- code = initial_enter_name("EMULATORS", &ifa);
+ code = i_initial_enter_name(i_ctx_p, "EMULATORS", &ifa);
if (code < 0)
return code;
/* Pass the search path. */
- code = initial_enter_name("LIBPATH", &minst->lib_path.list);
+ code = i_initial_enter_name(i_ctx_p, "LIBPATH", &minst->lib_path.list);
if (code < 0)
return code;