pidgin: 257e0418: Fix a potential leak "KuSh" discovered u...

datallah at pidgin.im datallah at pidgin.im
Mon Dec 22 12:05:55 EST 2008


-----------------------------------------------------------------
Revision: 257e0418889f66cfd4b2748653d5ef12a1eb2cdc
Ancestor: cb40166cf43bdc5d123509c6f2dfe83441c98018
Author: datallah at pidgin.im
Date: 2008-12-22T16:15:40
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/257e0418889f66cfd4b2748653d5ef12a1eb2cdc

Modified files:
        libpurple/protocols/sametime/sametime.c

ChangeLog: 

Fix a potential leak "KuSh" discovered using "cppcheck". Fixes #7862.

-------------- next part --------------
============================================================
--- libpurple/protocols/sametime/sametime.c	0fb86a786a6b29c9e90f5abc6fb87f62188aa907
+++ libpurple/protocols/sametime/sametime.c	ee32a4745fc76a4fe1905316783e5070222dd0b5
@@ -3724,7 +3724,6 @@ static void mw_prpl_login(PurpleAccount 
   gc->flags |= PURPLE_CONNECTION_NO_IMAGES;
 
   user = g_strdup(purple_account_get_username(account));
-  pass = g_strdup(purple_account_get_password(account));
 
   host = strrchr(user, ':');
   if(host) {
@@ -3741,10 +3740,12 @@ static void mw_prpl_login(PurpleAccount 
   if(! host || ! *host) {
     /* somehow, we don't have a host to connect to. Well, we need one
        to actually continue, so let's ask the user directly. */
+    g_free(user);
     prompt_host(gc);
     return;
   }
 
+  pass = g_strdup(purple_account_get_password(account));
   port = purple_account_get_int(account, MW_KEY_PORT, MW_PLUGIN_DEFAULT_PORT);
 
   DEBUG_INFO("user: '%s'\n", user);


More information about the Commits mailing list