diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2014-04-25 16:05:46 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-08-27 17:35:24 +0200 |
commit | d8cf10043563bdc43bc9ef32d6faed1fe0ebfba1 (patch) | |
tree | 6617c052494843cf2d6fa6a05b55f2f0c5685a28 | |
parent | 92e663be86868f0bed69b402812c1ee107c039ee (diff) |
RestProxyCall: Handle soup_error_new() failures
If given a URI it can't parse, soup_error_new() will return NULL.
https://bugzilla.gnome.org/show_bug.cgi?id=728953
(cherry picked from commit 22f044e197cb3c3ce9b1e19972bfd95eb0d53d82)
-rw-r--r-- | rest/rest-proxy-call.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 3e3474b..62079f4 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -775,6 +775,15 @@ prepare_message (RestProxyCall *call, GError **error_out) } message = soup_message_new (priv->method, priv->url); + if (message == NULL) { + g_free (content); + g_free (content_type); + g_set_error_literal (error_out, + REST_PROXY_ERROR, + REST_PROXY_ERROR_FAILED, + "Could not parse URI"); + return NULL; + } soup_message_set_request (message, content_type, SOUP_MEMORY_TAKE, content, content_len); |