technology: return already enabled when tethering is enabled
[framework/connectivity/connman.git] / gweb / gresolv.c
index cd5a5bf..e93bf4f 100644 (file)
@@ -607,8 +607,10 @@ static void add_result(struct resolv_lookup *lookup, int family,
                                                        const void *data)
 {
        int n = lookup->nr_results++;
-       lookup->results = g_realloc(lookup->results,
+       lookup->results = g_try_realloc(lookup->results,
                                        sizeof(struct sort_result) * (n + 1));
+       if (lookup->results == NULL)
+               return;
 
        memset(&lookup->results[n], 0, sizeof(struct sort_result));