From 06936d1f263c456017e20ea6c74d2756e1e30fcc Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sat, 9 Oct 2010 11:54:37 +0200 Subject: Have rad_decode() verify responses. --- lib/examples/client-blocking.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/examples') diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c index 66f4859..365b3b0 100644 --- a/lib/examples/client-blocking.c +++ b/lib/examples/client-blocking.c @@ -55,10 +55,16 @@ blocking_client (const char *av1, const char *av2) #if !defined(USE_REQUEST_OBJECT) if (rs_packet_send (req, NULL)) - return rs_err_conn_pop (conn); - req = NULL; - if (rs_conn_receive_packet (conn, &resp)) - return rs_err_conn_pop (conn); + { + rs_packet_destroy (req); + return rs_err_conn_pop (conn); + } + if (rs_conn_receive_packet (conn, req, &resp)) + { + rs_packet_destroy (req); + return rs_err_conn_pop (conn); + } + rs_packet_destroy (req); #else { struct rs_request *request; -- cgit v1.1