mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 03:36:58 -04: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
2 changed files with 21 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue