diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2022-01-24 19:51:49 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2022-01-25 10:43:33 +0000 |
commit | a2092ed3ed3e0dd889809260a77a9c94ddf3dd84 (patch) | |
tree | 5d2c33332464ce16301c1d17d6686632d90e7f14 /psi | |
parent | c5cb467a5f1c0303a2a87d14c645b154c74f68a9 (diff) | |
download | ghostpdl-a2092ed3ed3e0dd889809260a77a9c94ddf3dd84.tar.gz |
OSS Fuzz 42916: Fix leak found when memory squeezing.
Utterly unrelated to the file in use! If an allocation fails,
don't forget to free the arg we just copied.
Diffstat (limited to 'psi')
-rw-r--r-- | psi/imainarg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/psi/imainarg.c b/psi/imainarg.c index f5fe1f3e0..aaf41b6bf 100644 --- a/psi/imainarg.c +++ b/psi/imainarg.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 @@ -833,7 +833,10 @@ run_stdin: if (strlen(adef) == 10 && strncmp(adef, "OutputFile", 10) == 0 && strlen(eqp) > 0) { code = gs_add_outputfile_control_path(minst->heap, eqp); - if (code < 0) return code; + if (code < 0) { + arg_free((char *)adef, minst->heap); + return code; + } } ialloc_set_space(idmemory, avm_system); |