aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-06-26 11:29:05 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-06-26 07:53:08 -0700
commit29b900099ea6558da34fab5d22b9c82ba3856cfb (patch)
tree53b97be2024d65e8341ccf1826b57372bd95215a
parent6297d4747dd28b68a0adeae4fa2b687b9efdb477 (diff)
downloadmmsd-29b900099ea6558da34fab5d22b9c82ba3856cfb.tar.gz
gweb: Use g_try_realloc instead of g_realloc
-rw-r--r--gweb/gresolv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index cd5a5bf..e93bf4f 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));