]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix mem leak because buffer is not expanded correctly.
authorSimon Josefsson <simon@josefsson.org>
Tue, 13 Jan 2009 13:31:57 +0000 (14:31 +0100)
committerSimon Josefsson <simon@josefsson.org>
Tue, 13 Jan 2009 13:31:57 +0000 (14:31 +0100)
lib/gnutls_state.c

index 3817ccbbc6057d1b4aab69711a2f0c81d2c90242..e4934b563292609eefcad8f1485c8bb83aba4738 100644 (file)
@@ -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);