1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpgsm,tests,tools: Fix memory leaks.

* sm/minip12.c (p12_parse): Fix creating new TLV with old TLV.
* sm/t-minip12.c (one_file): Release RESULT.
* tests/gpgscm/ffi.c (do_process_wait): Call gpgrt_process_release.
* tools/gpgconf-comp.c (retrieve_options_from_program): Release PARGS.
* tools/gpgtar-extract.c (gpgtar_extract): Release PROC on leave.
* tools/gpgtar-list.c (gpgtar_list): Release PROC on leave.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2025-05-28 15:50:10 +09:00
parent 1587b387c0
commit 29bc14f56f
No known key found for this signature in database
GPG key ID: 640114AF89DE6054
6 changed files with 23 additions and 8 deletions

View file

@ -1222,12 +1222,23 @@ do_process_wait (scheme *sc, pointer args)
FFI_ARG_OR_RETURN (sc, struct proc_object_box *, box, proc, args);
FFI_ARG_OR_RETURN (sc, int, hang, bool, args);
FFI_ARGS_DONE_OR_RETURN (sc, args);
err = gpgrt_process_wait (box->proc, hang);
if (!err)
err = gpgrt_process_ctl (box->proc, GPGRT_PROCESS_GET_EXIT_ID, &retcode);
if (err == GPG_ERR_TIMEOUT)
err = 0;
if (!box->proc)
{
if (verbose)
fprintf (stderr, "caught already (%p)\n", box);
}
else
{
err = gpgrt_process_wait (box->proc, hang);
if (!err)
{
err = gpgrt_process_ctl (box->proc, GPGRT_PROCESS_GET_EXIT_ID, &retcode);
gpgrt_process_release (box->proc);
box->proc = NULL;
}
if (err == GPG_ERR_TIMEOUT)
err = 0;
}
FFI_RETURN_INT (sc, retcode);
}