diff options
author | Szymon Tokarz <wsx22@o2.pl> | 2016-01-17 00:02:29 +0000 |
---|---|---|
committer | Szymon Tokarz <wsx22@o2.pl> | 2016-01-17 00:02:29 +0000 |
commit | 67218eaf83e947cc7dd8a8be0224b90e0b35f31a (patch) | |
tree | 353067ac38d518b0271bf35f75707a40ada49e4a /protocols/Sametime/src/userlist.cpp | |
parent | efa07c67497a060009ebb5ec001dbd89684a4e17 (diff) |
Sametime protocol:
- patch fixes some memory leaks reported by Coverity and some other fixes and cleanup (by Wishmaster)
- some fixes by me
git-svn-id: http://svn.miranda-ng.org/main/trunk@16106 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Sametime/src/userlist.cpp')
-rw-r--r-- | protocols/Sametime/src/userlist.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index eb4a67fecc..2b85a75c0e 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -511,7 +511,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware) db_free(&dbv);
}
- GList* query = g_list_prepend(0, (void*)aware->id.user);
+ GList* query = g_list_prepend(0, aware->id.user);
mwServiceResolve_resolve(proto->service_resolve, query, mwResolveFlag_USERS, mwResolve_handler_dyngroup_callback, (gpointer)stgroup, 0);
g_list_free(query);
@@ -682,14 +682,12 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code mcsr.psr.cbSize = sizeof(MYPROTOSEARCHRESULT);
if (code == mwResolveCode_SUCCESS) {
- GList *ri = results, *mri;
- for (; ri; ri = ri->next) {
- mri = ((mwResolveResult *)ri->data)->matches;
- for (; mri; mri = mri->next) {
+ for (GList *ri = results; ri; ri = ri->next) {
+ for (GList *mri = ((mwResolveResult *)ri->data)->matches; mri; mri = mri->next) {
strncpy_s(mcsr.stid, ((mwResolveMatch *)mri->data)->id, _TRUNCATE);
MultiByteToWideChar(CP_UTF8, 0, mcsr.stid, -1, mcsr.pszFields[0], 512);
- strncpy(mcsr.name, ((mwResolveMatch *)mri->data)->name, _TRUNCATE);
+ strncpy_s(mcsr.name, ((mwResolveMatch *)mri->data)->name, _TRUNCATE);
MultiByteToWideChar(CP_UTF8, 0, mcsr.name, -1, mcsr.pszFields[1], 512);
if (((mwResolveMatch *)mri->data)->desc)
@@ -742,7 +740,7 @@ void mwResolve_handler_details_callback(mwServiceResolve* srvc, guint32 id, guin int CSametimeProto::SearchForUser(const char* name, BOOLEAN advanced)
{
if (m_iStatus != ID_STATUS_OFFLINE && service_resolve) {
- GList *query = g_list_prepend(0, (void*)name);
+ GList *query = g_list_prepend(0, (gpointer) name);
guint32 id = mwServiceResolve_resolve(service_resolve, query, (mwResolveFlag)(mwResolveFlag_USERS | mwResolveFlag_GROUPS), &mwResolve_handler_callback, (gpointer)advanced, 0);
g_list_free(query);
return id; // search handle
|