diff options
Diffstat (limited to 'tools/gpgsplit.c')
-rw-r--r-- | tools/gpgsplit.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/gpgsplit.c b/tools/gpgsplit.c index 7257b63e1..cc7bf8ef5 100644 --- a/tools/gpgsplit.c +++ b/tools/gpgsplit.c @@ -582,7 +582,10 @@ write_part (FILE *fpin, unsigned long pktlen, { c = getc (fpin); if (c == EOF) - goto read_error; + { + xfree (blob); + goto read_error; + } blob[i] = c; } len = public_key_length (blob, pktlen); @@ -594,18 +597,27 @@ write_part (FILE *fpin, unsigned long pktlen, if ( (hdr[0] & 0x40) ) { if (write_new_header (fpout, pkttype, len)) - goto write_error; + { + xfree (blob); + goto write_error; + } } else { if (write_old_header (fpout, pkttype, len)) - goto write_error; + { + xfree (blob); + goto write_error; + } } for (i=0; i < len; i++) { if ( putc (blob[i], fpout) == EOF ) - goto write_error; + { + xfree (blob); + goto write_error; + } } goto ready; |