[SSSD] [PATCH] DYNDNS: Return right error code in case of failure

Lukas Slebodnik lslebodn at redhat.com
Wed Sep 23 12:01:09 UTC 2015


ehlo,

another patch which should fix warning
reported by static analyzers.

LS
-------------- next part --------------
>From ed143ebfbf69b1e383ba6c6276eb160d0743b9c7 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Wed, 23 Sep 2015 13:50:22 +0200
Subject: [PATCH] DYNDNS: Return right error code in case of failure

The variable will be zero if getifaddrs succeeds
and therefore wrong error code will be returned
in case of insufficient memory (talloc_zero failed)
---
 src/providers/dp_dyndns.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c
index 50b087446f9437466de355e4d72b39a69512da03..a5eb383bd4f6c08b846a69f0588b9c25647dc5c8 100644
--- a/src/providers/dp_dyndns.c
+++ b/src/providers/dp_dyndns.c
@@ -228,6 +228,7 @@ sss_iface_addr_list_get(TALLOC_CTX *mem_ctx, const char *ifname,
             /* Add this address to the IP address list */
             address = talloc_zero(mem_ctx, struct sss_iface_addr);
             if (!address) {
+                ret = ENOMEM;
                 goto done;
             }
 
-- 
2.5.0



More information about the sssd-devel mailing list