Patch from Scott McKellar; allows the compiler to warn us of missing casts
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 28 May 2007 20:08:47 +0000 (20:08 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 28 May 2007 20:08:47 +0000 (20:08 +0000)
coming from undefined safe_malloc()s, NULL-initialize pointers (\0 != NULL).

http://list.georgialibraries.org/pipermail/open-ils-dev/2007-May/001098.html

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@919 9efc2488-bf62-4759-914b-345cdb29e865

src/libtransport/transport_client.c

index 9587711..a318127 100644 (file)
@@ -51,13 +51,18 @@ transport_client* client_init( const char* server, int port, const char* unix_pa
 
        /* build and clear the client object */
        size_t c_size = sizeof( transport_client);
-       transport_client* client = (transport_client*) safe_malloc( c_size );
+       transport_client* client = safe_malloc( c_size );
 
        /* build and clear the message list */
        size_t l_size = sizeof( transport_message_list );
-       client->m_list = (transport_message_list*) safe_malloc( l_size );
+       client->m_list = safe_malloc( l_size );
 
+       client->m_list->next = NULL;
+       client->m_list->message = NULL;
        client->m_list->type = MESSAGE_LIST_HEAD;
+
+       /* build the session */
+       
        client->session = init_transport( server, port, unix_path, client, component );
 
        client->session->message_callback = client_message_handler;