agent: Fix non-allocation for pinentry_loopback.

* agent/call-pinentry.c (agent_get_passphrase): Don't allocate, it will
be allocated by pinentry_loopback.
This commit is contained in:
NIIBE Yutaka 2015-10-06 02:05:04 +09:00
parent f3959f14b6
commit ce2a84b588
1 changed files with 2 additions and 4 deletions

View File

@ -1063,12 +1063,10 @@ agent_get_passphrase (ctrl_t ctrl,
{
size_t size;
size_t len = ASSUAN_LINELENGTH/2;
unsigned char *buffer = gcry_malloc_secure (len);
unsigned char *buffer;
rc = pinentry_loopback(ctrl, "PASSPHRASE", &buffer, &size, len);
if (rc)
xfree(buffer);
else
if (!rc)
{
buffer[size] = 0;
*retpass = buffer;