Revision b74b9f73d85a741c3fe858ae812f8d0fdb1f752a
nosnilmot at pidgin.im
nosnilmot at pidgin.im
Wed Apr 11 01:23:18 EDT 2007
o -----------------------------------------------------------------
| Revision: b74b9f73d85a741c3fe858ae812f8d0fdb1f752a
| Ancestor: b12b7c710ac127c2f990cad9bbba832cb7c01302
| Author: nosnilmot
| Date: 2005-01-17T00:32:32
| Branch: im.pidgin.gaim.oldstatus
|
| Modified files:
| plugins/ssl/ssl-nss.c plugins/tcl/tcl_signals.c
| src/gtkaccount.c src/protocols/msn/msn.h
| src/protocols/msn/nexus.c src/protocols/msn/notification.c
| src/protocols/msn/session.c src/protocols/msn/session.h
| src/protocols/msn/slp.c
|
| ChangeLog:
|
| [gaim-migrate @ 11832]
| Leak fixes, round #2. And some minor MSN tweaks suggested by Felipe.
| ============================================================
| --- plugins/ssl/ssl-nss.c 3b3bc6c2abcc039f7cc3d3ab1d544477eba9f5f9
| +++ plugins/ssl/ssl-nss.c 8fb0103f611d1414e98b985413c0228f81cda4bd
| @@ -57,18 +57,18 @@ ssl_nss_init_nss(void)
| static void
| ssl_nss_init_nss(void)
| {
| + char *lib;
| PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
| NSS_NoDB_Init(NULL);
|
| /* TODO: Fix this so autoconf does the work trying to find this lib. */
| - SECMOD_AddNewModule("Builtins",
| #ifndef _WIN32
| - g_strdup(BR_LIBDIR("/libnssckbi.so")),
| - /* this might leak, and looks wrong in general */
| + lib = g_strdup(BR_LIBDIR("/libnssckbi.so"));
| #else
| - "nssckbi.dll",
| + lib = g_strdup("nssckbi.dll");
| #endif
| - 0, 0);
| + SECMOD_AddNewModule("Builtins", lib, 0, 0);
| + g_free(lib);
| NSS_SetDomesticPolicy();
|
| _identity = PR_GetUniqueIdentity("Gaim");
| ============================================================
| --- plugins/tcl/tcl_signals.c 87c32bb8b769b82138af222742fbcb98eb66faff
| +++ plugins/tcl/tcl_signals.c ef0ca5ee2c71f7aa0b3e2c80ac530283f26bfe5c
| @@ -43,12 +43,17 @@ void tcl_signal_handler_free(struct tcl_
|
| void tcl_signal_handler_free(struct tcl_signal_handler *handler)
| {
| + int i;
| +
| if (handler == NULL)
| return;
|
| g_free(handler->signal);
| - if (handler->argnames != NULL)
| + if (handler->argnames != NULL) {
| + for (i = 0; i < handler->nnames; i++)
| + g_free(handler->argnames[i]);
| g_free(handler->argnames);
| + }
| Tcl_DecrRefCount(handler->proc);
| g_free(handler);
| }
| ============================================================
| --- src/gtkaccount.c 0b1d417f8668dad355abd390f2d9bd5b171266a0
| +++ src/gtkaccount.c 0349e716b50cc2bdfe594377479d93823222563b
| @@ -246,7 +246,7 @@ icon_filesel_choose_cb(GtkWidget *widget
| static void
| icon_filesel_choose_cb(GtkWidget *widget, gint response, AccountPrefsDialog *dialog)
| {
| - const char *filename;
| + char *filename;
|
| if (response != GTK_RESPONSE_ACCEPT) {
| if (response == GTK_RESPONSE_CANCEL)
| @@ -260,15 +260,16 @@ icon_filesel_choose_cb(GtkWidget *w, Acc
| static void
| icon_filesel_choose_cb(GtkWidget *w, AccountPrefsDialog *dialog)
| {
| - const char *filename;
| + char *filename;
|
| - filename = gtk_file_selection_get_filename(
| - GTK_FILE_SELECTION(dialog->icon_filesel));
| + filename = g_strdup(gtk_file_selection_get_filename(
| + GTK_FILE_SELECTION(dialog->icon_filesel)));
|
| /* If they typed in a directory, change there */
| if (gaim_gtk_check_if_dir(filename,
| GTK_FILE_SELECTION(dialog->icon_filesel)))
| {
| + g_free(filename);
| return;
| }
| #endif /* FILECHOOSER */
| @@ -281,6 +282,7 @@ icon_filesel_choose_cb(GtkWidget *w, Acc
|
| gtk_widget_destroy(dialog->icon_filesel);
| dialog->icon_filesel = NULL;
| + g_free(filename);
| }
|
| static void
| @@ -294,18 +296,21 @@ icon_preview_change_cb(GtkTreeSelection
| int height, width;
| char *basename, *markup, *size;
| struct stat st;
| - const char *filename;
| + char *filename;
|
| #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */
| filename = gtk_file_chooser_get_preview_filename(
| GTK_FILE_CHOOSER(dialog->icon_filesel));
| #else /* FILECHOOSER */
| - filename = gtk_file_selection_get_filename(
| - GTK_FILE_SELECTION(dialog->icon_filesel));
| + filename = g_strdup(gtk_file_selection_get_filename(
| + GTK_FILE_SELECTION(dialog->icon_filesel)));
| #endif /* FILECHOOSER */
|
| if (!filename || stat(filename, &st))
| + {
| + g_free(filename);
| return;
| + }
|
| pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
| if (!pixbuf) {
| @@ -315,6 +320,7 @@ icon_preview_change_cb(GtkTreeSelection
| gtk_file_chooser_set_preview_widget_active(
| GTK_FILE_CHOOSER(dialog->icon_filesel), FALSE);
| #endif /* FILECHOOSER */
| + g_free(filename);
| return;
| }
|
| @@ -338,6 +344,7 @@ icon_preview_change_cb(GtkTreeSelection
|
| g_object_unref(G_OBJECT(pixbuf));
| g_object_unref(G_OBJECT(scale));
| + g_free(filename);
| g_free(basename);
| g_free(size);
| g_free(markup);
| @@ -537,6 +544,8 @@ convert_buddy_icon(GaimPlugin *plugin, c
| prpl_info->icon_spec.max_width >= width &&
| prpl_info->icon_spec.min_height <= height &&
| prpl_info->icon_spec.max_height >= height))) { /* The icon is the correct size */
| + g_strfreev(prpl_formats);
| + g_strfreev(pixbuf_formats);
| #endif
| return g_strdup(path);
| #if GTK_CHECK_VERSION(2,2,0)
| @@ -548,6 +557,7 @@ convert_buddy_icon(GaimPlugin *plugin, c
| const char *dirname = gaim_buddy_icons_get_cache_dir();
| char *filename = g_build_filename(dirname, random, NULL);
| pixbuf = gdk_pixbuf_new_from_file(path, &error);
| + g_strfreev(pixbuf_formats);
| if (!error && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_SEND) {
| int new_width = gdk_pixbuf_get_width(pixbuf);
| int new_height = gdk_pixbuf_get_height(pixbuf);
| @@ -571,6 +581,7 @@ convert_buddy_icon(GaimPlugin *plugin, c
| g_free(random);
| gaim_debug_error("buddyicon", "Could not open icon for conversion: %s\n", error->message);
| g_error_free(error);
| + g_strfreev(prpl_formats);
| return NULL;
| }
|
| @@ -581,6 +592,7 @@ convert_buddy_icon(GaimPlugin *plugin, c
| gaim_debug_error("buddyicon",
| "Unable to create directory %s: %s\n",
| dirname, strerror(errno));
| + g_strfreev(prpl_formats);
| return NULL;
| }
| }
| @@ -592,6 +604,7 @@ convert_buddy_icon(GaimPlugin *plugin, c
| if (gdk_pixbuf_save (pixbuf, filename, prpl_formats[i], &error, NULL) == TRUE)
| break;
| }
| + g_strfreev(prpl_formats);
| if (!error) {
| g_free(random);
| g_object_unref(G_OBJECT(pixbuf));
| @@ -1293,6 +1306,9 @@ account_win_destroy_cb(GtkWidget *w, Gdk
| if (dialog->protocol_id != NULL)
| g_free(dialog->protocol_id);
|
| + if (dialog->icon_path != NULL)
| + g_free(dialog->icon_path);
| +
| if (dialog->icon_filesel)
| gtk_widget_destroy(dialog->icon_filesel);
|
| ============================================================
| --- src/protocols/msn/msn.h 9c91fee0e5efa1a3fe84ca2749df6cfde22fbb98
| +++ src/protocols/msn/msn.h a43442874549177027f0546f456c9e360da90bc3
| @@ -24,6 +24,14 @@
| #ifndef _MSN_H_
| #define _MSN_H_
|
| +/* #define MSN_DEBUG_MSG 1 */
| +/* #define MSN_DEBUG_SLPMSG 1 */
| +/* #define MSN_DEBUG_HTTP 1 */
| +
| +/* #define MSN_DEBUG_SLP 1 */
| +/* #define MSN_DEBUG_SLP_VERBOSE 1 */
| +/* #define MSN_DEBUG_SLP_FILES 1 */
| +
| #include "internal.h"
|
| #include "account.h"
| @@ -45,14 +53,6 @@
|
| #include "ft.h"
|
| -/* #define MSN_DEBUG_MSG 1 */
| -/* #define MSN_DEBUG_SLPMSG 1 */
| -/* #define MSN_DEBUG_HTTP 1 */
| -
| -/* #define MSN_DEBUG_SLP 1 */
| -/* #define MSN_DEBUG_SLP_VERBOSE 1 */
| -/* #define MSN_DEBUG_SLP_FILES 1 */
| -
| #define MSN_BUF_LEN 8192
|
| #define USEROPT_MSNSERVER 3
| ============================================================
| --- src/protocols/msn/nexus.c d5649035ce838e7f1367d98c25243ac302e7b07b
| +++ src/protocols/msn/nexus.c f54fd42744b2afe062d596b626c278dffa953431
| @@ -132,8 +132,7 @@ login_connect_cb(gpointer data, GaimSslC
| session = nexus->session;
| g_return_if_fail(session != NULL);
|
| - if (!session->logged_in)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_GET_COOKIE);
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_GET_COOKIE);
|
| username =
| g_strdup(gaim_url_encode(gaim_account_get_username(session->account)));
| @@ -313,8 +312,7 @@ nexus_connect_cb(gpointer data, GaimSslC
| session = nexus->session;
| g_return_if_fail(session != NULL);
|
| - if (!session->logged_in)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH);
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH);
|
| request_str = g_strdup_printf("GET /rdr/pprdr.asp\r\n\r\n");
|
| ============================================================
| --- src/protocols/msn/notification.c 8c3c064ed9620a5ce9c8ae7418b27e5c4c12e67b
| +++ src/protocols/msn/notification.c 6e287594059ab381f3fff2328ead58db118fb3d9
| @@ -111,13 +111,10 @@ connect_cb(MsnServConn *servconn)
|
| vers = g_strjoinv(" ", a);
|
| - if (!session->logged_in)
| - {
| - if (session->login_step == MSN_LOGIN_STEP_START)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE);
| - else
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2);
| - }
| + if (session->login_step == MSN_LOGIN_STEP_START)
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE);
| + else
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2);
|
| msn_cmdproc_send(cmdproc, "VER", "%s", vers);
|
| @@ -206,8 +203,7 @@ msn_got_login_params(MsnSession *session
|
| cmdproc = session->notification->cmdproc;
|
| - if (!session->logged_in)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END);
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END);
|
| msn_cmdproc_send(cmdproc, "USR", "TWN S %s", login_params);
| }
| @@ -241,8 +237,7 @@ usr_cmd(MsnCmdProc *cmdproc, MsnCommand
|
| gaim_connection_set_display_name(gc, friendly);
|
| - if (!session->logged_in)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);
|
| msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
| }
| @@ -267,8 +262,7 @@ usr_cmd(MsnCmdProc *cmdproc, MsnCommand
|
| g_strfreev(elems);
|
| - if (!session->logged_in)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START);
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START);
|
| msn_nexus_connect(session->nexus);
| }
| @@ -299,7 +293,7 @@ ver_cmd(MsnCmdProc *cmdproc, MsnCommand
|
| if (!protocol_supported)
| {
| - msn_session_set_error(session, MSN_ERROR_UNSUPORTED_PROTOCOL,
| + msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL,
| NULL);
| return;
| }
| @@ -1011,8 +1005,7 @@ xfr_cmd(MsnCmdProc *cmdproc, MsnCommand
|
| session = cmdproc->session;
|
| - if (!session->logged_in)
| - msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER);
| + msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER);
|
| msn_notification_connect(session->notification, host, port);
| }
| ============================================================
| --- src/protocols/msn/session.c 958772cdc6fc5e4324d6d158ef49fb4c98e83fb8
| +++ src/protocols/msn/session.c 1303d141e9c85289a3a9ff09a9e376c4c3090286
| @@ -291,7 +291,7 @@ msn_session_set_error(MsnSession *sessio
| case MSN_ERROR_SERVCONN:
| msg = g_strdup(info);
| break;
| - case MSN_ERROR_UNSUPORTED_PROTOCOL:
| + case MSN_ERROR_UNSUPPORTED_PROTOCOL:
| msg = g_strdup(_("Our protocol is not supported by the "
| "server."));
| break;
| @@ -350,6 +350,17 @@ msn_session_set_login_step(MsnSession *s
| {
| GaimConnection *gc;
|
| + /* Prevent the connection progress going backwards, eg. if we get
| + * transferred several times during login */
| + if (session->login_step >= step)
| + return;
| +
| + /* If we're already logged in, we're probably here because of a
| + * mid-session XFR from the notification server, so we don't want to
| + * popup the connection progress dialog */
| + if (session->logged_in)
| + return;
| +
| gc = session->account->gc;
|
| session->login_step = step;
| ============================================================
| --- src/protocols/msn/session.h e37509f33c1441d07c04b3ea21b04054c304d29e
| +++ src/protocols/msn/session.h cf4a920bc75e2a4797c8c1ea1935c3ea1be58a10
| @@ -46,7 +46,7 @@ typedef enum
| typedef enum
| {
| MSN_ERROR_SERVCONN,
| - MSN_ERROR_UNSUPORTED_PROTOCOL,
| + MSN_ERROR_UNSUPPORTED_PROTOCOL,
| MSN_ERROR_HTTP_MALFORMED,
| MSN_ERROR_AUTH,
| MSN_ERROR_BAD_BLIST,
| ============================================================
| --- src/protocols/msn/slp.c 0394c08021090da7f475567c7681938405ae581b
| +++ src/protocols/msn/slp.c f04371eacfbe58bc3df09dc151b3419541ed99f6
| @@ -290,6 +290,8 @@ got_sessionreq(MsnSlpCall *slpcall, cons
| g_return_if_reached();
| }
|
| + msn_object_destroy(obj);
| +
| slpsession = msn_slplink_find_slp_session(slplink,
| slpcall->session_id);
|
| @@ -645,6 +647,7 @@ msn_slp_sip_recv(MsnSlpLink *slplink, co
|
| got_invite(slpcall, branch, content_type, content);
|
| + g_free(branch);
| g_free(content_type);
| g_free(content);
| }
| @@ -1005,6 +1008,7 @@ msn_request_user_display(MsnUser *user)
|
| /* TODO: I think we need better buddy icon core functions. */
| gaim_buddy_icons_set_for_user(account, user->passport, (void *)data, len);
| + g_free(data);
|
| sl = gaim_find_buddies(account, user->passport);
|
To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from b74b9f73d85a741c3fe858ae812f8d0fdb1f752a
More information about the Commits
mailing list