aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/http_client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/http_client.c b/lib/http_client.c
index 1dc5947a..9110b70a 100644
--- a/lib/http_client.c
+++ b/lib/http_client.c
@@ -161,7 +161,9 @@ error:
req->status_string = g_strdup("Error while writing HTTP request");
}
- req->func(req);
+ if (req->func != NULL) {
+ req->func(req);
+ }
http_free(req);
return FALSE;
}
@@ -298,7 +300,9 @@ cleanup:
req->status_string ? req->status_string : "NULL");
}
- req->func(req);
+ if (req->func != NULL) {
+ req->func(req);
+ }
http_free(req);
return FALSE;
}
@@ -411,7 +415,7 @@ static http_ret_t http_process_data(struct http_request *req, const char *buffer
req->body_size = req->sblen - pos;
}
- if ((req->flags & HTTPC_STREAMING) && req->reply_body) {
+ if ((req->flags & HTTPC_STREAMING) && req->reply_body && req->func != NULL) {
req->func(req);
}