summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-08-02 12:12:22 +0200
committerTimm Bäder <mail@baedert.org>2017-02-21 17:38:59 +0100
commit2f828797fd2334efc5baa08da2947a9071b6478f (patch)
treed09969b4401c2a6e7122ae780fc6db487234f48f
parent51b3f42ff220e1015f176724b3132e647462e1f1 (diff)
downloadlibrest-2f828797fd2334efc5baa08da2947a9071b6478f.tar.gz
OAuth2Proxy: g_free is null-safe
-rw-r--r--rest/oauth2-proxy.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/rest/oauth2-proxy.c b/rest/oauth2-proxy.c
index 2d3315b..c312fcf 100644
--- a/rest/oauth2-proxy.c
+++ b/rest/oauth2-proxy.c
@@ -88,18 +88,15 @@ oauth2_proxy_set_property (GObject *object, guint property_id,
switch (property_id) {
case PROP_CLIENT_ID:
- if (priv->client_id)
- g_free (priv->client_id);
+ g_free (priv->client_id);
priv->client_id = g_value_dup_string (value);
break;
case PROP_AUTH_ENDPOINT:
- if (priv->auth_endpoint)
- g_free (priv->auth_endpoint);
+ g_free (priv->auth_endpoint);
priv->auth_endpoint = g_value_dup_string (value);
break;
case PROP_ACCESS_TOKEN:
- if (priv->access_token)
- g_free (priv->access_token);
+ g_free (priv->access_token);
priv->access_token = g_value_dup_string (value);
break;
default:
@@ -363,9 +360,7 @@ oauth2_proxy_set_access_token (OAuth2Proxy *proxy, const char *access_token)
{
g_return_if_fail (OAUTH2_IS_PROXY (proxy));
- if (proxy->priv->access_token)
- g_free (proxy->priv->access_token);
-
+ g_free (proxy->priv->access_token);
proxy->priv->access_token = g_strdup (access_token);
}