From 8d353eb15ab8ba9c0edba76dfb955b5f13bf20f3 Mon Sep 17 00:00:00 2001 From: Brett Bryant Date: Wed, 18 Jun 2008 20:07:56 +0000 Subject: Fix a crash in tcp and tls connections related to reference counts. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123692 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/tcptls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main/tcptls.c') diff --git a/main/tcptls.c b/main/tcptls.c index 9ce3ac9b8..f51a44701 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -276,6 +276,7 @@ struct ast_tcptls_session_instance *ast_tcptls_client_start(struct server_args * __ssl_setup(desc->tls_cfg, 1); } + ao2_ref(ser, +1); if (!ast_make_file_from_fd(ser)) goto error; @@ -460,7 +461,7 @@ void *ast_make_file_from_fd(void *data) if (!ser->f) { close(ser->fd); ast_log(LOG_WARNING, "FILE * open failed!\n"); - ast_free(ser); + ao2_ref(ser, -1); return NULL; } -- cgit v1.2.3