pidgin: 592fe2e2: Don't leak the GError from g_convert.

qulogic at pidgin.im qulogic at pidgin.im
Fri Jul 31 00:45:34 EDT 2009


-----------------------------------------------------------------
Revision: 592fe2e2316aeff56f4671a5767dffe1fb57003d
Ancestor: a53078a1ec59ed925fe780058384b1ad7005590b
Author: qulogic at pidgin.im
Date: 2009-07-31T04:42:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/592fe2e2316aeff56f4671a5767dffe1fb57003d

Modified files:
        libpurple/protocols/msn/slpcall.c

ChangeLog: 

Don't leak the GError from g_convert.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slpcall.c	c485ab48b7d47d1ea170e2ccc24aeb521a6e2045
+++ libpurple/protocols/msn/slpcall.c	69f42f67a9bbd41c9f695d12689c76df33539b84
@@ -217,10 +217,12 @@ msn_slp_process_msg(MsnSlpLink *slplink,
 			 || body_len <= 0
 			 || strstr(body_str, "image/gif") == NULL)
 			{
-				if (error != NULL)
+				if (error != NULL) {
 					purple_debug_error("msn",
 					                   "Unable to convert Ink header from UTF-16 to UTF-8: %s\n",
 					                   error->message);
+					g_error_free(error);
+				}
 				else
 					purple_debug_error("msn",
 					                   "Received Ink in unknown format\n");
@@ -234,9 +236,15 @@ msn_slp_process_msg(MsnSlpLink *slplink,
 			                     &bytes_read, &bytes_written, &error);
 			if (!body_str)
 			{
-				purple_debug_error("msn",
-				                   "Unable to convert Ink body from UTF-16 to UTF-8: %s\n",
-				                   error->message);
+				if (error != NULL) {
+					purple_debug_error("msn",
+					                   "Unable to convert Ink body from UTF-16 to UTF-8: %s\n",
+					                   error->message);
+					g_error_free(error);
+				}
+				else
+					purple_debug_error("msn",
+					                   "Received Ink in unknown format\n");
 				return NULL;
 			}
 


More information about the Commits mailing list