From 22f044e197cb3c3ce9b1e19972bfd95eb0d53d82 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 25 Apr 2014 16:05:46 +0200 Subject: 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 --- rest/rest-proxy-call.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 6e553bd..a264f2e 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -783,6 +783,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); -- cgit v1.2.1