From: Simon Josefsson Date: Tue, 13 Jan 2009 13:31:57 +0000 (+0100) Subject: Fix mem leak because buffer is not expanded correctly. X-Git-Tag: gnutls_2_7_5~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca5739968c1397be9d4e454f52d7cd3378d5c87b;p=thirdparty%2Fgnutls.git Fix mem leak because buffer is not expanded correctly. --- diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index 3817ccbbc6..e4934b5632 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation * * Author: Nikos Mavrogiannopoulos * @@ -309,12 +309,12 @@ gnutls_init (gnutls_session_t * session, gnutls_connection_end_t con_end) gnutls_handshake_set_max_packet_length ((*session), MAX_HANDSHAKE_PACKET_SIZE); - /* Allocate a minimum size for recv_data + /* Allocate a minimum size for recv_data * This is allocated in order to avoid small messages, making * the receive procedure slow. */ - (*session)->internals.record_recv_buffer.data = - gnutls_malloc (INITIAL_RECV_BUFFER_SIZE); + _gnutls_buffer_resize (&(*session)->internals.record_recv_buffer, + INITIAL_RECV_BUFFER_SIZE); if ((*session)->internals.record_recv_buffer.data == NULL) { gnutls_free ((*session)->key);