summaryrefslogtreecommitdiff
path: root/lib/examples
diff options
context:
space:
mode:
Diffstat (limited to 'lib/examples')
-rw-r--r--lib/examples/client-blocking.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c
index bb9e653..365b3b0 100644
--- a/lib/examples/client-blocking.c
+++ b/lib/examples/client-blocking.c
@@ -55,17 +55,23 @@ 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;
- if (rs_request_new (conn, &request))
+ if (rs_request_create (conn, &request))
return rs_err_conn_pop (conn);
- if (rs_req_send (request, req, &resp))
+ if (rs_request_send (request, req, &resp))
return rs_err_conn_pop (conn);
rs_request_destroy (request);
}