changeset 28348:c4fa41bb1672

Fixing leak is nice, but let's not crash in the process.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 08 Oct 2009 19:15:31 +0000
parents c5e0b85c3145
children 203839bc0f7c
files libpurple/account.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Thu Oct 08 18:16:41 2009 +0000
+++ b/libpurple/account.c	Thu Oct 08 19:15:31 2009 +0000
@@ -1052,8 +1052,10 @@
 
 	priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
 	PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error);
-	g_free(priv->current_error->description);
-	g_free(priv->current_error);
+	if (priv->current_error) {
+		g_free(priv->current_error->description);
+		g_free(priv->current_error);
+	}
 	g_free(priv);
 
 	PURPLE_DBUS_UNREGISTER_POINTER(account);