comparison libpurple/protocols/yahoo/libymsg.c @ 30109:ccaaee2a8e59

Fix a typo and a memleak.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 10 Apr 2010 21:28:07 +0000
parents 258454cfecee
children 708c35476cff
comparison
equal deleted inserted replaced
30108:258454cfecee 30109:ccaaee2a8e59
1771 for(i = 0; i < elements; i++) { 1771 for(i = 0; i < elements; i++) {
1772 if(g_ascii_strncasecmp(splits[i], "Set-Cookie: B=", 14) == 0) { 1772 if(g_ascii_strncasecmp(splits[i], "Set-Cookie: B=", 14) == 0) {
1773 tmp = &splits[i][14]; 1773 tmp = &splits[i][14];
1774 sem = strchr(tmp, ';'); 1774 sem = strchr(tmp, ';');
1775 1775
1776 if(tmp != NULL) { 1776 if (sem != NULL) {
1777 tmp2 = g_strndup(tmp, sem - tmp); 1777 tmp2 = g_strndup(tmp, sem - tmp);
1778 purple_debug_info("yahoo", "Got needed part of B cookie: %s\n", 1778 purple_debug_info("yahoo", "Got needed part of B cookie: %s\n",
1779 tmp2 ? tmp2 : "(null)"); 1779 tmp2 ? tmp2 : "(null)");
1780 break; 1780 break;
1781 } 1781 }
1782 } 1782 }
1783 } 1783 }
1784 } 1784 }
1785 1785
1786 g_strfreev(splits);
1786 return tmp2; 1787 return tmp2;
1787 } 1788 }
1788 1789
1789 static void yahoo_auth16_stage2(PurpleUtilFetchUrlData *unused, gpointer user_data, const gchar *ret_data, size_t len, const gchar *error_message) 1790 static void yahoo_auth16_stage2(PurpleUtilFetchUrlData *unused, gpointer user_data, const gchar *ret_data, size_t len, const gchar *error_message)
1790 { 1791 {