From d93280e01a923facccebf6042513ff66492705ca Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 2 Feb 2022 11:27:31 +0100 Subject: auth: Fix compile-time warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../rest/rest-oauth2-proxy.c: In function ‘rest_oauth2_proxy_build_authorization_url’: /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘params_string’ may be used uninitialized [-Wmaybe-uninitialized] 28 | g_free (*pp); | ^~~~~~~~~~~~ ../rest/rest-oauth2-proxy.c:355:21: note: ‘params_string’ was declared here 355 | g_autofree gchar *params_string; | ^~~~~~~~~~~~~ ../rest/rest-oauth2-proxy.c: In function ‘rest_oauth2_proxy_new_call’: /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘auth’ may be used uninitialized in this function [-Wmaybe-uninitialized] 28 | g_free (*pp); | ^~~~~~~~~~~~ ../rest/rest-oauth2-proxy.c:114:21: note: ‘auth’ was declared here 114 | g_autofree gchar *auth; | ^~~~ --- rest/rest-oauth2-proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/rest-oauth2-proxy.c b/rest/rest-oauth2-proxy.c index f15b589..fb66f91 100644 --- a/rest/rest-oauth2-proxy.c +++ b/rest/rest-oauth2-proxy.c @@ -111,7 +111,7 @@ rest_oauth2_proxy_new_call (RestProxy *proxy) { RestOAuth2Proxy *self = (RestOAuth2Proxy *)proxy; RestProxyCall *call; - g_autofree gchar *auth; + g_autofree gchar *auth = NULL; g_return_val_if_fail (REST_IS_OAUTH2_PROXY (self), NULL); @@ -352,7 +352,7 @@ rest_oauth2_proxy_build_authorization_url (RestOAuth2Proxy *self, g_autoptr(GHashTable) params = NULL; g_autoptr(GUri) auth = NULL; g_autoptr(GUri) authorization_url = NULL; - g_autofree gchar *params_string; + g_autofree gchar *params_string = NULL; g_return_val_if_fail (REST_IS_OAUTH2_PROXY (self), NULL); -- cgit v1.2.1