g10: Fix memory leak.

* g10/export.c (do_export_stream): Free secret parameters.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-06-30 18:49:15 +02:00
parent eb4cdbefb0
commit 401db0eebb
1 changed files with 9 additions and 0 deletions

View File

@ -1557,6 +1557,15 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
xfree (pk->seckey_info);
pk->seckey_info = NULL;
{
int i;
for (i = pubkey_get_npkey (pk->pubkey_algo);
i < pubkey_get_nskey (pk->pubkey_algo); i++)
{
gcry_mpi_release (pk->pkey[i]);
pk->pkey[i] = NULL;
}
}
xfree (hexgrip);
}
else