summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-01-13 14:31:57 +0100
committerSimon Josefsson <simon@josefsson.org>2009-01-13 14:31:57 +0100
commitca5739968c1397be9d4e454f52d7cd3378d5c87b (patch)
tree0a9cfd7ae32ff1348db7c90c3d4938721ba0124c /lib
parentf679e0cfa5ad3c7e48ad7e0d1a8f762c452a18bd (diff)
downloadgnutls-ca5739968c1397be9d4e454f52d7cd3378d5c87b.tar.gz
Fix mem leak because buffer is not expanded correctly.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_state.c8
1 files changed, 4 insertions, 4 deletions
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);