summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-01 00:41:34 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-01 00:41:34 +0100
commitf762125c8296407c918e75c90f30166d7e546b11 (patch)
tree534145daca72f656c5b00a9ce78ca5cddfd60fe9 /lib
parentf8118c1c2330bdcb8bf2df653f0cd17b66dc48cc (diff)
rs_request_send: Check arguments and that we have a packet to send.
Diffstat (limited to 'lib')
-rw-r--r--lib/request.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/request.c b/lib/request.c
index b03d434..9aa29cb 100644
--- a/lib/request.c
+++ b/lib/request.c
@@ -102,6 +102,9 @@ rs_request_send (struct rs_request *request, struct rs_packet **resp_msg)
assert (request->req_msg);
conn = request->conn;
+ if (!request || !request->conn || !request->req_msg || !resp_msg)
+ return rs_err_conn_push_fl (conn, RSE_INVAL, __FILE__, __LINE__, NULL);
+
request->saved_cb = conn->callbacks;
conn->callbacks.connected_cb = _rs_req_connected;