mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 16:09:35 -05:00
thunders patch, mem leak, and ignored return vals
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3350 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cf75bee791
commit
9ff6849a55
@ -1470,7 +1470,6 @@ bool p3GroupDistrib::loadList(std::list<RsItem *> load)
|
||||
/* for child config data */
|
||||
std::list<RsItem* > childLoadL;
|
||||
RsSerialType* childSer = createSerialiser();
|
||||
uint32_t pktSize;
|
||||
|
||||
for(lit = load.begin(); lit != load.end(); lit++)
|
||||
{
|
||||
@ -2205,7 +2204,9 @@ std::string p3GroupDistrib::publishMsg(RsDistribMsg *msg, bool personalSign)
|
||||
|
||||
delete[] data;
|
||||
}else{
|
||||
|
||||
delete[] data;
|
||||
delete signedMsg;
|
||||
delete serialType;
|
||||
return msgId;
|
||||
}
|
||||
|
||||
@ -2233,6 +2234,8 @@ std::string p3GroupDistrib::publishMsg(RsDistribMsg *msg, bool personalSign)
|
||||
signedMsg->publishSignature.signData.setBinData(sigbuf, siglen);
|
||||
signedMsg->publishSignature.keyId = gi->publishKeyId;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
if (personalSign)
|
||||
{
|
||||
unsigned int siglen = MAX_GPG_SIGNATURE_SIZE;
|
||||
@ -2241,6 +2244,8 @@ std::string p3GroupDistrib::publishMsg(RsDistribMsg *msg, bool personalSign)
|
||||
{
|
||||
signedMsg->personalSignature.signData.setBinData(sigbuf, siglen);
|
||||
signedMsg->personalSignature.keyId = AuthGPG::getAuthGPG()->getGPGOwnId();
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2249,6 +2254,11 @@ std::string p3GroupDistrib::publishMsg(RsDistribMsg *msg, bool personalSign)
|
||||
EVP_MD_CTX_destroy(mdctx);
|
||||
delete[] out_data;
|
||||
|
||||
if (ok == false) {
|
||||
delete signedMsg;
|
||||
return msgId;
|
||||
}
|
||||
|
||||
} /* END STACK MUTEX */
|
||||
|
||||
/* extract Ids from publishSignature */
|
||||
|
@ -224,9 +224,6 @@ bool p3Forums::getForumThreadMsgList(std::string fId, std::string pId, std::list
|
||||
|
||||
bool p3Forums::getForumMessage(std::string fId, std::string mId, ForumMsgInfo &info)
|
||||
{
|
||||
std::list<std::string> msgIds;
|
||||
std::list<std::string>::iterator it;
|
||||
|
||||
RsStackMutex stack(distribMtx); /***** STACK LOCKED MUTEX *****/
|
||||
|
||||
RsDistribMsg *msg = locked_getGroupMsg(fId, mId);
|
||||
@ -265,6 +262,10 @@ bool p3Forums::ForumMessageSend(ForumMsgInfo &info)
|
||||
std::string mId = createForumMsg(info.forumId, info.parentId,
|
||||
info.title, info.msg, signIt);
|
||||
|
||||
if (mId.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setMessageStatus(info.forumId, mId, FORUM_MSG_STATUS_READ);
|
||||
|
||||
return true;
|
||||
@ -326,6 +327,11 @@ std::string p3Forums::createForumMsg(std::string fId, std::string pId,
|
||||
fmsg->timestamp = time(NULL);
|
||||
|
||||
std::string msgId = publishMsg(fmsg, signIt);
|
||||
|
||||
if (msgId.empty()) {
|
||||
delete(fmsg);
|
||||
}
|
||||
|
||||
return msgId;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user