1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

g10: Fix memory leak.

* g10/decrypt-data.c (decrypt_data): Free 'filename'.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-03-28 12:10:28 +02:00
parent caf0091553
commit 6d3edfd972
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020

View File

@ -222,7 +222,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
if (opt.unwrap_encryption) if (opt.unwrap_encryption)
{ {
char *filename; char *filename = NULL;
estream_t fp; estream_t fp;
rc = get_output_file ("", 0, ed->buf, &filename, &fp); rc = get_output_file ("", 0, ed->buf, &filename, &fp);
if (! rc) if (! rc)
@ -248,6 +248,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
if (afx) if (afx)
release_armor_context (afx); release_armor_context (afx);
} }
xfree (filename);
} }
else else
proc_packets (ctrl, procctx, ed->buf ); proc_packets (ctrl, procctx, ed->buf );