lm_socket_create doesn't ref the ssl object.
Reported by Justin Bronder | April 16th, 2009 @ 07:57 PM
From 8a1beda2cb6a5a4d19cf157125153b091ed34182 Mon Sep 17 00:00:00 2001 From: Justin Bronder jsbronder@gmail.com Date: Tue, 14 Apr 2009 14:55:46 -0400 Subject: [PATCH] lm_socket_create needs to ref the ssl object.
On failure to create a socket, for instance a timeout when querying the nameserver, lm_socket_unref will unallocate the ssl object. A later attempt to create a socket will result in a segfault. This patch simply
adds a reference to the ssl object in lm_socket_create.
loudmouth/lm-socket.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/loudmouth/lm-socket.c b/loudmouth/lm-socket.c index 8add572..e174e93 100644 --- a/loudmouth/lm-socket.c +++ b/loudmouth/lm-socket.c @@ -1070,11 +1070,14 @@ lm_socket_create (GMainContext *context,
socket->server = g_strdup (server);
socket->port = port;
socket->cancel_open = FALSE;
-
socket->ssl = ssl; socket->ssl_started = FALSE; socket->proxy = NULL; socket->blocking = blocking;
-
if (ssl) {
-
socket->ssl = lm_ssl_ref(ssl); - } + if (context) {
} -- 1.6.0.6socket->context = g_main_context_ref (context);
Comments and changes to this ticket
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Libloudmouth is a lightweight and easy-to-use C library for programming with the Jabber protocol. It's designed to be easy to get started with and yet extensible to let you do anything the Jabber protocol allows.
