summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-07-14 12:33:34 +0200
committerTimm Bäder <mail@baedert.org>2016-07-14 12:33:34 +0200
commit672c2b8a6d379ca71c328cbcc30a20532fe46a4e (patch)
tree106d46316747f84d5515948b8b92af1c7289d7c3
parent1c2e5d826127ce6f0c51e75ee2b55e9d2ed4f615 (diff)
downloadlibrest-672c2b8a6d379ca71c328cbcc30a20532fe46a4e.tar.gz
rest-proxy: Add some missing preconditions
-rw-r--r--rest/rest-proxy.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c
index 9061221..086c217 100644
--- a/rest/rest-proxy.c
+++ b/rest/rest-proxy.c
@@ -437,6 +437,8 @@ RestProxy *
rest_proxy_new (const gchar *url_format,
gboolean binding_required)
{
+ g_return_val_if_fail (url_format != NULL, NULL);
+
return g_object_new (REST_TYPE_PROXY,
"url-format", url_format,
"binding-required", binding_required,
@@ -465,6 +467,10 @@ rest_proxy_new_with_authentication (const gchar *url_format,
const gchar *username,
const gchar *password)
{
+ g_return_val_if_fail (url_format != NULL, NULL);
+ g_return_val_if_fail (username != NULL, NULL);
+ g_return_val_if_fail (password != NULL, NULL);
+
return g_object_new (REST_TYPE_PROXY,
"url-format", url_format,
"binding-required", binding_required,
@@ -503,11 +509,11 @@ rest_proxy_bind_valist (RestProxy *proxy,
gboolean
rest_proxy_bind (RestProxy *proxy, ...)
{
- g_return_val_if_fail (REST_IS_PROXY (proxy), FALSE);
-
gboolean res;
va_list params;
+ g_return_val_if_fail (REST_IS_PROXY (proxy), FALSE);
+
va_start (params, proxy);
res = rest_proxy_bind_valist (proxy, params);
va_end (params);
@@ -562,6 +568,7 @@ rest_proxy_add_soup_feature (RestProxy *proxy, SoupSessionFeature *feature)
RestProxyPrivate *priv = GET_PRIVATE (proxy);
g_return_if_fail (REST_IS_PROXY(proxy));
+ g_return_if_fail (feature != NULL);
g_return_if_fail (priv->session != NULL);
soup_session_add_feature (priv->session, feature);