diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-02 11:27:31 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-02 11:28:28 +0100 |
commit | d93280e01a923facccebf6042513ff66492705ca (patch) | |
tree | e29056e00a869a1159df0964bcd57cea32ea9128 | |
parent | 19862a6803c35e55be5fb7d15f985e4232dede85 (diff) | |
download | librest-d93280e01a923facccebf6042513ff66492705ca.tar.gz |
auth: Fix compile-time warnings
../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;
| ^~~~
-rw-r--r-- | rest/rest-oauth2-proxy.c | 4 |
1 files 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); |