[Freeipa-devel] [PATCH 0099] Remove dead code detected by clang static analyzer

Adam Tkac atkac at redhat.com
Thu Nov 22 13:12:02 UTC 2012


On Wed, Nov 21, 2012 at 03:59:21PM +0100, Petr Spacek wrote:
> Hello,
> 
> 	Remove dead code detected by clang static analyzer.
> 

Ack

> From 8bdab9e7d7d71a11f363873ebfbd979662474bfc Mon Sep 17 00:00:00 2001
> From: Petr Spacek <pspacek at redhat.com>
> Date: Wed, 21 Nov 2012 12:59:00 +0100
> Subject: [PATCH] Remove dead code detected by clang static analyzer.
> 
> Signed-off-by: Petr Spacek <pspacek at redhat.com>
> ---
>  src/ldap_convert.c | 3 ---
>  src/ldap_helper.c  | 4 ++--
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/src/ldap_convert.c b/src/ldap_convert.c
> index 3352c573cafc54421c77b0b770657841b90ebd71..9589add4428cbac3ed467e5ae738c3f7a48e7474 100644
> --- a/src/ldap_convert.c
> +++ b/src/ldap_convert.c
> @@ -144,8 +144,6 @@ dn_to_text(const char *dn, ld_string_t *target, ld_string_t *origin)
>  	REQUIRE(dn != NULL);
>  	REQUIRE(target != NULL);
>  
> -	result = ISC_R_SUCCESS;
> -
>  	CHECK(explode_dn(dn, &exploded_dn, 0));
>  	str_clear(target);
>  	for (i = 0; exploded_dn[i] != NULL; i++) {
> @@ -283,7 +281,6 @@ dns_to_ldap_dn_escape(isc_mem_t *mctx, const char const * dns_str, char ** ldap_
>  		int length_ok = dns_idx - idx_symb_first;
>  		memcpy(esc_name + esc_idx, dns_str + idx_symb_first, dns_idx - idx_symb_first);
>  		esc_idx += length_ok;
> -		idx_symb_first = -1;
>  	}
>  	esc_name[esc_idx] = '\0';
>  	return ISC_R_SUCCESS;
> diff --git a/src/ldap_helper.c b/src/ldap_helper.c
> index 7da07eabd5c712006276021d56e5972b4de9a3e1..c85fd7feca348bdd63bba33409fc740b399e61dd 100644
> --- a/src/ldap_helper.c
> +++ b/src/ldap_helper.c
> @@ -1280,7 +1280,7 @@ ldap_parse_zoneentry(ldap_entry_t *entry, ldap_instance_t *inst)
>  		publish = ISC_TRUE;
>  		log_debug(2, "created zone %p: %s", zone, dn);
>  	} else if (result != ISC_R_SUCCESS)
> -		CLEANUP_WITH(result);
> +		goto cleanup;
>  
>  	log_debug(2, "Setting SSU table for %p: %s", zone, dn);
>  	/* Get the update policy and update the zone with it. */
> @@ -3285,7 +3285,7 @@ update_zone(isc_task_t *task, isc_event_t *event)
>  			 LDAP_SCOPE_BASE, attrs_zone, 0,
>  			 "(&(objectClass=idnsZone)(idnsZoneActive=TRUE))");
>  	if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND)
> -		CLEANUP_WITH(result);
> +		goto cleanup;
>  
>  	if (result == ISC_R_SUCCESS &&
>  	    HEAD(ldap_qresult_zone->ldap_entries) != NULL) {
> -- 
> 1.7.11.7
> 


-- 
Adam Tkac, Red Hat, Inc.




More information about the Freeipa-devel mailing list