summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp12
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp16
-rw-r--r--protocols/Gadu-Gadu/src/libgadu/common.c10
-rw-r--r--protocols/Gadu-Gadu/src/libgadu/dcc7.c2
-rw-r--r--protocols/Gadu-Gadu/src/libgadu/pubdir.c2
-rw-r--r--protocols/Gadu-Gadu/src/ownerinfo.cpp4
7 files changed, 23 insertions, 27 deletions
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index ad7933052f..0845a550be 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -97,7 +97,7 @@ int GGPROTO::gc_destroy()
for(l = chats; l; l = l->next)
{
GGGC *chat = (GGGC *)l->data;
- if (chat->recipients) free(chat->recipients);
+ free(chat->recipients);
}
list_destroy(chats, 1); chats = NULL;
return 1;
@@ -606,7 +606,7 @@ INT_PTR GGPROTO::gc_clearignored(WPARAM wParam, LPARAM lParam)
l = l->next;
if (chat->ignore)
{
- if (chat->recipients) free(chat->recipients);
+ free(chat->recipients);
list_remove(&chats, chat, 1);
cleared = TRUE;
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 88efe07a86..abcd765e88 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -139,12 +139,10 @@ static int gg_img_releasepicture(void *img)
{
if (!img)
return FALSE;
- if (((GGIMAGEENTRY *)img)->lpszFileName)
- free(((GGIMAGEENTRY *)img)->lpszFileName);
+ free(((GGIMAGEENTRY *)img)->lpszFileName);
if (((GGIMAGEENTRY *)img)->hBitmap)
DeleteObject(((GGIMAGEENTRY *)img)->hBitmap);
- if (((GGIMAGEENTRY *)img)->lpData)
- free(((GGIMAGEENTRY *)img)->lpData);
+ free(((GGIMAGEENTRY *)img)->lpData);
free(img);
return TRUE;
@@ -1067,10 +1065,8 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
debugLogA("img_loadpicture(): MS_IMG_LOAD(MEM) failed.");
if (dat)
{
- if (dat->lpData)
- free(dat->lpData);
- if (dat->lpszFileName)
- free(dat->lpszFileName);
+ free(dat->lpData);
+ free(dat->lpszFileName);
free(dat);
}
return NULL;
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index 523d077111..1ac699ffcd 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -237,14 +237,14 @@ void GGPROTO::parsecontacts(char *contacts)
}
// Release stuff
- if (strFirstName) free(strFirstName);
- if (strLastName) free(strLastName);
- if (strNickname) free(strNickname);
- if (strNick) free(strNick);
- if (strPhone) free(strPhone);
- if (strGroup) free(strGroup);
- if (strUin) free(strUin);
- if (strMail) free(strMail);
+ free(strFirstName);
+ free(strLastName);
+ free(strNickname);
+ free(strNick);
+ free(strPhone);
+ free(strGroup);
+ free(strUin);
+ free(strMail);
}
}
diff --git a/protocols/Gadu-Gadu/src/libgadu/common.c b/protocols/Gadu-Gadu/src/libgadu/common.c
index b9b41c0547..f1db6c4b7f 100644
--- a/protocols/Gadu-Gadu/src/libgadu/common.c
+++ b/protocols/Gadu-Gadu/src/libgadu/common.c
@@ -366,7 +366,7 @@ char *gg_read_line(SOCKET sock, char *buf, int length)
*
* \ingroup helper
*/
-#ifdef GG_CONFIG_MIRANDA
+#ifdef GG_CONFIG_MIRANDA
SOCKET gg_connect_internal(void *addr, int port, int async, SOCKET *gg_sock)
#else
SOCKET gg_connect(void *addr, int port, int async)
@@ -398,8 +398,8 @@ SOCKET gg_connect(void *addr, int port, int async)
return -1;
}
-#ifdef GG_CONFIG_MIRANDA
- if (gg_sock) *gg_sock = sock;
+#ifdef GG_CONFIG_MIRANDA
+ if (gg_sock) *gg_sock = sock;
#endif
if (async) {
@@ -435,7 +435,7 @@ SOCKET gg_connect(void *addr, int port, int async)
return sock;
}
-#ifdef GG_CONFIG_MIRANDA
+#ifdef GG_CONFIG_MIRANDA
SOCKET gg_connect(void *addr, int port, int async)
{
return gg_connect_internal(addr, port, async, 0);
@@ -541,7 +541,7 @@ int gg_http_hash(const char *format, ...)
char *arg, buf[16];
if (format[j] == 'u') {
- snprintf(buf, sizeof(buf), "%d", va_arg(ap, uin_t));
+ mir_snprintf(buf, sizeof(buf), "%d", va_arg(ap, uin_t));
arg = buf;
} else {
if (!(arg = va_arg(ap, char*)))
diff --git a/protocols/Gadu-Gadu/src/libgadu/dcc7.c b/protocols/Gadu-Gadu/src/libgadu/dcc7.c
index f3813e6e83..fcfefa0500 100644
--- a/protocols/Gadu-Gadu/src/libgadu/dcc7.c
+++ b/protocols/Gadu-Gadu/src/libgadu/dcc7.c
@@ -330,7 +330,7 @@ static int gg_dcc7_listen_and_send_info(struct gg_dcc7 *dcc)
// we MUST fill hash to recive from server request for server connection
//snprintf((char*) pkt.hash, sizeof(pkt.hash), "0");
count = dcc->local_addr + external_port * rand();
- snprintf((char*) pkt.hash, sizeof(pkt.hash), "%d", count);
+ mir_snprintf(pkt.hash, sizeof(pkt.hash), "%d", count);
return gg_send_packet(dcc->sess, GG_DCC7_INFO, &pkt, sizeof(pkt), NULL);
}
diff --git a/protocols/Gadu-Gadu/src/libgadu/pubdir.c b/protocols/Gadu-Gadu/src/libgadu/pubdir.c
index f9d656dfe3..c74ff4f309 100644
--- a/protocols/Gadu-Gadu/src/libgadu/pubdir.c
+++ b/protocols/Gadu-Gadu/src/libgadu/pubdir.c
@@ -735,7 +735,7 @@ int gg_token_watch_fd(struct gg_http *h)
gg_debug(GG_DEBUG_MISC, "=> token body \"%s\"\n", h->body);
- if (h->body && (!(url = malloc(strlen(h->body))) || !(tokenid = malloc(strlen(h->body))))) {
+ if (h->body && (!(url = (char*)malloc(strlen(h->body) + 1)) || !(tokenid = (char*)malloc(strlen(h->body) + 1)))) {
gg_debug(GG_DEBUG_MISC, "=> token, not enough memory for results\n");
free(url);
return -1;
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp
index a8f56eb856..25bb183156 100644
--- a/protocols/Gadu-Gadu/src/ownerinfo.cpp
+++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp
@@ -39,7 +39,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param)
debugLogA("remindpasswordthread(): Started.");
if (!rp || !rp->email || !rp->uin || !strlen(rp->email))
{
- if (rp) free(rp);
+ free(rp);
#ifdef DEBUGMODE
debugLogA("remindpasswordthread(): End. err1");
#endif
@@ -68,7 +68,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param)
MessageBox(NULL, TranslateT("Password was sent to your e-mail."), m_tszUserName, MB_OK | MB_ICONINFORMATION);
}
- if (rp) free(rp);
+ free(rp);
#ifdef DEBUGMODE
debugLogA("remindpasswordthread(): End.");
#endif