[PATCH] gweb: Check null before reference

Danny Jeongseok Seo s.seo at samsung.com
Thu Nov 8 21:44:12 PST 2012


Check NULL before making a reference.
---
 gweb/gresolv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index d30e2f1..fbb7a54 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -1003,11 +1003,11 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname,
 {
 	struct resolv_lookup *lookup;
 
-	debug(resolv, "hostname %s", hostname);
-
 	if (resolv == NULL)
 		return 0;
 
+	debug(resolv, "hostname %s", hostname);
+
 	if (resolv->nameserver_list == NULL) {
 		int i;
 
-- 
1.7.10.4




More information about the connman mailing list