« Return to Thread: memory allocation bug in C client library

Re: memory allocation bug in C client library

by Jeff Ward :: Rate this Message:

Reply to Author | View in Thread

Hey Theo,

This is fixed in svn now.  Using sizeof(stomp_conneciton) over sizeof(*conneciton);

--
Jeff

On Wed, May 27, 2009 at 1:28 PM, Theo Schlossnagle <jesus@...> wrote:

You currently underallocate the connection in the pool.  Patch follows:


Index: trunk/c/src/stomp.c
===================================================================
--- stomp.c     (revision 88)
+++ stomp.c     (working copy)
@@ -35,7 +35,7 @@
       //
       // Allocate the connection and a memory pool for the connection.
       //
-       connection = apr_pcalloc(pool, sizeof(connection));
+       connection = apr_pcalloc(pool, sizeof(*connection));
       if( connection == NULL )
               return APR_ENOMEM;

--
View this message in context: http://www.nabble.com/memory-allocation-bug-in-C-client-library-tp23747094p23747094.html
Sent from the stomp - dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



 « Return to Thread: memory allocation bug in C client library