memory leaks from missing gpgme_data_release

- AuthGPG::privateSignCertificate
- AuthGPG::privateTrustCertificate


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3160 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-06-18 22:58:27 +00:00
parent 09ac44316a
commit 19674c4d86

View File

@ -1439,14 +1439,17 @@ int AuthGPG::privateSignCertificate(std::string id)
gpgme_signers_clear(CTX);
if(GPG_ERR_NO_ERROR != (ERR = gpgme_signers_add(CTX, ownKey))) {
gpgme_data_release(out);
return 0;
}
if(GPG_ERR_NO_ERROR != (ERR = gpgme_op_edit(CTX, signKey, keySignCallback, &params, out))) {
gpgme_data_release(out);
return 0;
}
gpgme_data_release(out);
return 1;
}
@ -1479,13 +1482,16 @@ int AuthGPG::privateTrustCertificate(std::string id, int trustlvl)
gpgme_data_t out;
gpg_error_t ERR;
if(GPG_ERR_NO_ERROR != (ERR = gpgme_data_new(&out))) {
return 0;
}
if(GPG_ERR_NO_ERROR != (ERR = gpgme_op_edit(CTX, trustKey, trustCallback, &params, out)))
if(GPG_ERR_NO_ERROR != (ERR = gpgme_op_edit(CTX, trustKey, trustCallback, &params, out))) {
gpgme_data_release(out);
return 0;
}
gpgme_data_release(out);
//the key ref has changed, we got to get rid of the old reference.
trustCert.key = NULL;