summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-02-28 22:39:29 +0100
committerLinus Nordberg <linus@nordu.net>2011-02-28 22:39:29 +0100
commit5bb45f3d784f53226942fde428a7cef8660127ad (patch)
treefa048fa5e8695e3388a1b6416f9a185b81a9a639 /lib
parent6703d5727a51dec8d076b783c6f40bcdc069de86 (diff)
Add asserts to request object.
Diffstat (limited to 'lib')
-rw-r--r--lib/request.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/request.c b/lib/request.c
index cfd0ddb..b03d434 100644
--- a/lib/request.c
+++ b/lib/request.c
@@ -16,6 +16,7 @@ int
rs_request_create (struct rs_connection *conn, struct rs_request **req_out)
{
struct rs_request *req = rs_malloc (conn->ctx, sizeof(*req));
+ assert (req_out);
if (!req)
return rs_err_conn_push_fl (conn, RSE_NOMEM, __FILE__, __LINE__, NULL);
memset (req, 0, sizeof(*req));
@@ -27,6 +28,7 @@ rs_request_create (struct rs_connection *conn, struct rs_request **req_out)
void
rs_request_add_reqpkt (struct rs_request *req, struct rs_packet *reqpkt)
{
+ assert (req);
req->req_msg = reqpkt;
}
@@ -37,7 +39,7 @@ rs_request_create_authn (struct rs_connection *conn,
const char *user_pw)
{
struct rs_request *req;
-
+ assert (req_out);
if (rs_request_create (conn, &req))
return -1;
@@ -51,6 +53,7 @@ rs_request_create_authn (struct rs_connection *conn,
void
rs_request_destroy (struct rs_request *request)
{
+ assert (request);
rs_packet_destroy (request->req_msg);
rs_packet_destroy (request->resp_msg);
rs_free (request->conn->ctx, request);