summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-06-26 08:29:05 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2012-06-26 14:53:01 (GMT)
commit2b84f61149ce85a0ce3d7d0e9c647c39aedd7187 (patch)
tree278ba0d43f82ad2d2c5cd52be9fde75c41a92b4c /gweb
parenta3e24ecbba6aa21bbe496c662e96c4b620e76ac9 (diff)
downloadconnman-2b84f61149ce85a0ce3d7d0e9c647c39aedd7187.zip
connman-2b84f61149ce85a0ce3d7d0e9c647c39aedd7187.tar.gz
connman-2b84f61149ce85a0ce3d7d0e9c647c39aedd7187.tar.bz2
gweb: Use g_try_realloc instead of g_realloc
Diffstat (limited to 'gweb')
-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));