Fix minor memory leak in Pageant key removal.

It wasn't freeing the key comment along with the key data, probably
because I originally based the code on the SSH-1 analogue and forgot
that freersakey() *does* free the comment.
This commit is contained in:
Simon Tatham 2018-05-27 09:29:33 +01:00
Родитель 5129c40bea
Коммит f6d04ef1c4
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -725,6 +725,7 @@ void pageant_handle_msg(BinarySink *bs,
del234(ssh2keys, key);
keylist_update();
key->alg->freekey(key->data);
sfree(key->comment);
sfree(key);
put_byte(bs, SSH_AGENT_SUCCESS);
@ -765,6 +766,7 @@ void pageant_handle_msg(BinarySink *bs,
while ((skey = index234(ssh2keys, 0)) != NULL) {
del234(ssh2keys, skey);
skey->alg->freekey(skey->data);
sfree(skey->comment);
sfree(skey);
}
keylist_update();