Fixed memory leak in RsRecogn::createTagRequest

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8453 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-14 21:30:23 +00:00
parent c187c03758
commit b61355e894

View File

@ -565,8 +565,6 @@ RsGxsRecognTagItem *RsRecogn::extractTag(const std::string &encoded)
bool RsRecogn::createTagRequest(const RsTlvSecurityKey &key, const RsGxsId &id, const std::string &nickname, uint16_t tag_class, uint16_t tag_type, const std::string &comment, std::string &tag) bool RsRecogn::createTagRequest(const RsTlvSecurityKey &key, const RsGxsId &id, const std::string &nickname, uint16_t tag_class, uint16_t tag_type, const std::string &comment, std::string &tag)
{ {
RsGxsRecognReqItem *item = new RsGxsRecognReqItem();
EVP_PKEY *signKey = EVP_PKEY_new(); EVP_PKEY *signKey = EVP_PKEY_new();
RSA *rsakey = d2i_RSAPrivateKey(NULL, (const unsigned char **)&key.keyData.bin_data, key.keyData.bin_len); RSA *rsakey = d2i_RSAPrivateKey(NULL, (const unsigned char **)&key.keyData.bin_data, key.keyData.bin_len);
@ -588,6 +586,8 @@ bool RsRecogn::createTagRequest(const RsTlvSecurityKey &key, const RsGxsId &id,
return false; return false;
} }
RsGxsRecognReqItem *item = new RsGxsRecognReqItem();
item->issued_at = time(NULL); item->issued_at = time(NULL);
item->period = 365 * 24 * 3600; item->period = 365 * 24 * 3600;
item->tag_class = tag_class; item->tag_class = tag_class;