diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-04-05 20:28:29 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-04-05 20:28:29 +0000 |
commit | 1b0236528ceec24b16d6ce91a188b2da240f1a7d (patch) | |
tree | d60e8e282a0eef4c3a50bb8df5f9512d565d3469 /protocols/Gadu-Gadu/src/userutils.cpp | |
parent | ab2852015641c9aa9aa2588fb21617e31b7da546 (diff) |
Gadu-Gadu: resource leak fixes, cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@16590 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/userutils.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/userutils.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index e1be7a0bfe..e513112247 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -22,7 +22,7 @@ ////////////////////////////////////////////////////////////////////////////////
// Create New Account : Proc
-
+//
void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
{
// Connection handles
@@ -67,11 +67,12 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail) ////////////////////////////////////////////////////////////////////////////////
// Remove Account : Proc
+//
void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password)
{
// Connection handles
struct gg_http *h;
- struct gg_pubdir *s;
+ struct gg_pubdir *s = NULL;
GGTOKEN token;
#ifdef DEBUGMODE
@@ -109,14 +110,14 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password) ////////////////////////////////////////////////////////////////////////////////
// Change Password Page : Proc
-
+//
void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
{
// Readup email
char email[255] = "\0"; DBVARIANT dbv_email;
// Connection handles
struct gg_http *h;
- struct gg_pubdir *s;
+ struct gg_pubdir *s = NULL;
GGTOKEN token;
#ifdef DEBUGMODE
@@ -160,7 +161,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) ////////////////////////////////////////////////////////////////////////////////
// Change E-mail Page : Proc
-
+//
void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *newEmail)
{
#ifdef DEBUGMODE
@@ -174,7 +175,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne return NULL;
// Connection handles
- struct gg_pubdir *s;
+ struct gg_pubdir *s = NULL;
struct gg_http *h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0);
if (!h || !(s = (gg_pubdir*)h->data) || !s->success)
{
@@ -201,6 +202,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne ////////////////////////////////////////////////////////////////////////////////
// User Util Dlg Page : Data
+//
INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
GGUSERUTILDLGDATA *dat = (GGUSERUTILDLGDATA *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -246,10 +248,18 @@ INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (!dat) break;
switch (dat->mode)
{
- case GG_USERUTIL_CREATE: gg_doregister(dat->gg, pass, email); break;
- case GG_USERUTIL_REMOVE: gg_dounregister(dat->gg, dat->uin, pass); break;
- case GG_USERUTIL_PASS: gg_dochpass(dat->gg, dat->uin, dat->pass, pass); break;
- case GG_USERUTIL_EMAIL: gg_dochemail(dat->gg, dat->uin, dat->pass, dat->email, email); break;
+ case GG_USERUTIL_CREATE:
+ gg_doregister(dat->gg, pass, email);
+ break;
+ case GG_USERUTIL_REMOVE:
+ gg_dounregister(dat->gg, dat->uin, pass);
+ break;
+ case GG_USERUTIL_PASS:
+ gg_dochpass(dat->gg, dat->uin, dat->pass, pass);
+ break;
+ case GG_USERUTIL_EMAIL:
+ gg_dochemail(dat->gg, dat->uin, dat->pass, dat->email, email);
+ break;
}
break;
}
@@ -269,7 +279,7 @@ INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA //////////////////////////////////////////////////////////
// Wait for thread to stop
-
+//
void GGPROTO::threadwait(GGTHREAD *thread)
{
if (!thread->hThread) return;
|