From ff43f6adfc9396fe36c3567f39194c878b7f9d05 Mon Sep 17 00:00:00 2001 From: Szymon Tokarz Date: Wed, 4 Dec 2013 23:31:55 +0000 Subject: Gadu-Gadu protocol - fix crashes on 'Import list from server', 'Export list to Server' and 'Remove list from server' functions (after r6938) git-svn-id: http://svn.miranda-ng.org/main/trunk@7052 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Gadu-Gadu/src/import.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'protocols/Gadu-Gadu/src') diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 12233c226c..1b181db775 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -264,7 +264,7 @@ INT_PTR GGPROTO::import_server(WPARAM wParam, LPARAM lParam) } // Readup password - char *password = getStringA(GG_KEY_PASSWORD); + ptrA password(getStringA(GG_KEY_PASSWORD)); if (password == NULL) return 0; @@ -283,7 +283,6 @@ INT_PTR GGPROTO::import_server(WPARAM wParam, LPARAM lParam) debugLogA("import_server(): Cannot import list. errno:%d: %s", errno, strerror(errno)); } gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 2, "sess_mutex", 1); - free(password); return 0; } @@ -303,7 +302,7 @@ INT_PTR GGPROTO::remove_server(WPARAM wParam, LPARAM lParam) } // Readup password - char *password = getStringA(GG_KEY_PASSWORD); + ptrA password(getStringA(GG_KEY_PASSWORD)); if (password == NULL) return 0; @@ -325,7 +324,6 @@ INT_PTR GGPROTO::remove_server(WPARAM wParam, LPARAM lParam) // Set list removal is_list_remove = TRUE; - free(password); return 0; } @@ -476,7 +474,7 @@ INT_PTR GGPROTO::export_server(WPARAM wParam, LPARAM lParam) } // Readup password - char *password = getStringA(GG_KEY_PASSWORD); + ptrA password(getStringA(GG_KEY_PASSWORD)); if (password == NULL) return 0; @@ -505,7 +503,6 @@ INT_PTR GGPROTO::export_server(WPARAM wParam, LPARAM lParam) // Set list removal is_list_remove = FALSE; free(contacts); - free(password); return 0; } -- cgit v1.2.3