From 8180d690325654be6e7ad87242564a34d09a899e Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 28 May 2007 20:08:47 +0000 Subject: [PATCH] Patch from Scott McKellar; allows the compiler to warn us of missing casts 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libtransport/transport_client.c b/src/libtransport/transport_client.c index 9587711..a318127 100644 --- a/src/libtransport/transport_client.c +++ b/src/libtransport/transport_client.c @@ -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; -- 2.11.0