aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mime-maker.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-12-08 12:04:06 +0000
committerWerner Koch <[email protected]>2016-12-08 12:08:02 +0000
commitdd03667ab1062bba3b9413c3f8007d63302d1b31 (patch)
treef2eddce56adede16d23f675501b0dc521d4288c0 /tools/mime-maker.c
parenttools: Fix memleak in gpgconf. (diff)
downloadgnupg-dd03667ab1062bba3b9413c3f8007d63302d1b31.tar.gz
gnupg-dd03667ab1062bba3b9413c3f8007d63302d1b31.zip
tools: Fix use of uninitialized var in mime-maker.
* tools/mime-maker.c (ensure_part): Make sure to set R_PARENT on error. (add_missing_headers): Ensure that ERR is set on success. * tools/wks-util.c (wks_parse_policy): Fix indentation. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/mime-maker.c')
-rw-r--r--tools/mime-maker.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/mime-maker.c b/tools/mime-maker.c
index ca05f1d40..2e3206964 100644
--- a/tools/mime-maker.c
+++ b/tools/mime-maker.c
@@ -251,7 +251,11 @@ ensure_part (mime_maker_t ctx, part_t *r_parent)
{
ctx->mail = xtrycalloc (1, sizeof *ctx->mail);
if (!ctx->mail)
- return gpg_error_from_syserror ();
+ {
+ if (r_parent)
+ *r_parent = NULL;
+ return gpg_error_from_syserror ();
+ }
log_assert (!ctx->current_part);
ctx->current_part = ctx->mail;
ctx->current_part->headers_tail = &ctx->current_part->headers;
@@ -722,6 +726,7 @@ add_missing_headers (mime_maker_t ctx)
goto leave;
}
+ err = 0;
leave:
return err;