summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-07-06 11:50:17 (GMT)
committerWill Thompson <will.thompson@collabora.co.uk>2009-07-06 11:50:17 (GMT)
commit2d44bc5fe1324778d5c47d90b7c5b58943966d6c (patch)
tree5dbe24f1c7d7440792ab83d19f41bab4ec6bb2ca
parent533b050865aa1afa82447eec98af82361010a599 (diff)
downloadpidgin-2d44bc5fe1324778d5c47d90b7c5b58943966d6c.tar.gz
pidgin-2d44bc5fe1324778d5c47d90b7c5b58943966d6c.tar.xz
Extract common PurpleSslConnection-freeing code
-rw-r--r--libpurple/sslconn.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libpurple/sslconn.c b/libpurple/sslconn.c
index 784cdfe..148b427 100644
--- a/libpurple/sslconn.c
+++ b/libpurple/sslconn.c
@@ -113,6 +113,13 @@ ssl_connection_new(PurpleAccount *account,
return gsc;
}
+static void
+ssl_connection_free(PurpleSslConnection *gsc)
+{
+ g_free(gsc->host);
+ g_free(gsc);
+}
+
PurpleSslConnection *
purple_ssl_connect(PurpleAccount *account, const char *host, int port,
PurpleSslInputFunction func, PurpleSslErrorFunction error_func,
@@ -140,9 +147,7 @@ purple_ssl_connect(PurpleAccount *account, const char *host, int port,
if (gsc->connect_data == NULL)
{
- g_free(gsc->host);
- g_free(gsc);
-
+ ssl_connection_free (gsc);
return NULL;
}
@@ -248,8 +253,7 @@ purple_ssl_close(PurpleSslConnection *gsc)
if (gsc->fd >= 0)
close(gsc->fd);
- g_free(gsc->host);
- g_free(gsc);
+ ssl_connection_free (gsc);
}
size_t