projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3e24ec
)
gweb: Use g_try_realloc instead of g_realloc
author
Jukka Rissanen
<jukka.rissanen@linux.intel.com>
Tue, 26 Jun 2012 08:29:05 +0000
(11:29 +0300)
committer
Marcel Holtmann
<marcel@holtmann.org>
Tue, 26 Jun 2012 14:53:01 +0000
(07:53 -0700)
gweb/gresolv.c
patch
|
blob
|
history
diff --git
a/gweb/gresolv.c
b/gweb/gresolv.c
index
cd5a5bf
..
e93bf4f
100644
(file)
--- 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));