[librest/wip/baedert/tests: 16/22] OAuth2Proxy: g_free is null-safe



commit d1acf7e9c18c5e85b2f5c4060deca529c65befcb
Author: Timm Bäder <mail baedert org>
Date:   Tue Aug 2 12:12:22 2016 +0200

    OAuth2Proxy: g_free is null-safe

 rest/oauth2-proxy.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/rest/oauth2-proxy.c b/rest/oauth2-proxy.c
index 2d3315b..846c5e9 100644
--- a/rest/oauth2-proxy.c
+++ b/rest/oauth2-proxy.c
@@ -363,9 +363,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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]