On Tue, 2016-04-12 at 08:59 +0530, Ravi Prasad RK wrote:
g_strdup() returns NULL only if 'nameserver' is NULL.
'nameserver' is checked for NULL at begining of function before
passing to g_strdup() function.
---
src/service.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/service.c b/src/service.c
index d9abbc4..1fff483 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1127,11 +1127,6 @@ int __connman_service_nameserver_append(struct
connman_service *service,
return -ENOMEM;
nameservers[len] = g_strdup(nameserver);
- if (!nameservers[len]) {
- g_strfreev(nameservers);
- return -ENOMEM;
- }
-
nameservers[len + 1] = NULL;
if (is_auto) {
Yes, except that this patch does not apply to upstream as it contains a
previous modification.
Patrik