Home GnuPG

gpgscm: Fix copying values.

Description

gpgscm: Fix copying values.

* tests/gpgscm/scheme.c (copy_value): New function.
(mk_tagged_value): Use new function.
(opexe_4): Likewise for OP_SAVE_FORCED.

Occasionally, we need to copy a value from one location in the storage
to another. Scheme objects are fine. Some primitive objects,
however, require finalization, usually to free resources.

For these values, we either make a copy or acquire a reference.

Fixes e.g. a double free if a delayed expression evaluating to a
string is forced.

  • Signed-off-by: Justus Winter <justus@g10code.com>

Details

Provenance
justusAuthored on Apr 4 2017, 5:36 PM
Parents
rEc9244b2eb43e: gpgscm: Simplify get-output-string operation.
Branches
Unknown
Tags
Unknown