diff options
-rw-r--r-- | gweb/gresolv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c index cd5a5bf2..e93bf4fc 100644 --- a/gweb/gresolv.c +++ b/gweb/gresolv.c @@ -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)); |