Hello,

    Fix error reporting for different TTLs in findrdatatype_or_create().

    Old code returned ISC_R_SUCCESS even in unsupported case.

    Bug found by Clang static code analysis.

--
Petr^2 Spacek
From db7de384c4f047555275c164fc9dbe0a5d9269c6 Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Thu, 22 Nov 2012 09:23:45 +0100
Subject: [PATCH] Fix error reporting for different TTLs in
 findrdatatype_or_create().

Old code returned ISC_R_SUCCESS even in unsupported case.

Bug found by Clang static code analysis.

Signed-off-by: Petr Spacek <pspa...@redhat.com>
---
 src/ldap_helper.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/ldap_helper.c b/src/ldap_helper.c
index 8a7765d5a650279db0417f6fb5be01a3dd2b82d4..8d23b6251b77a63cb22c484663a1169c0b1a31e3 100644
--- a/src/ldap_helper.c
+++ b/src/ldap_helper.c
@@ -1600,13 +1600,15 @@ findrdatatype_or_create(isc_mem_t *mctx, ldapdb_rdatalist_t *rdatalist,
 		rdlist->type = rdtype;
 		rdlist->ttl = ttl;
 		APPEND(*rdatalist, rdlist, link);
-		result = ISC_R_SUCCESS;
 	} else {
 		/*
 		 * No support for different TTLs yet.
 		 */
-		if (rdlist->ttl != ttl)
-			result = ISC_R_FAILURE;
+		if (rdlist->ttl != ttl) {
+			log_error("different TTLs in single rdata list "
+				  "are not supported");
+			CLEANUP_WITH(ISC_R_NOTIMPLEMENTED);
+		}
 	}
 
 	*rdlistp = rdlist;
-- 
1.7.11.7

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to