[Freeipa-devel] [PATCH 0067] Fix error handling in ldap_get_zone_serial()

Adam Tkac atkac at redhat.com
Mon Sep 24 13:16:38 UTC 2012


On Fri, Sep 21, 2012 at 03:26:27PM +0200, Petr Spacek wrote:
> Hello,
> 
>     Fix error handling in ldap_get_zone_serial().
> 
>     Successful call of zr_get_zone_ptr() attaches zone. Zone has to be
>     detached regardless of dns_zone_getserial2() return code.

Ack.

> From 5c88eed63ec896bfb4fddb3677dc63b0855c0f6a Mon Sep 17 00:00:00 2001
> From: Petr Spacek <pspacek at redhat.com>
> Date: Fri, 21 Sep 2012 15:16:45 +0200
> Subject: [PATCH] Fix error handling in ldap_get_zone_serial().
> 
> Successful call of zr_get_zone_ptr() attaches zone. Zone has to be
> detached regardless of dns_zone_getserial2() return code.
> 
> Signed-off-by: Petr Spacek <pspacek at redhat.com>
> ---
>  src/ldap_helper.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/ldap_helper.c b/src/ldap_helper.c
> index 2245cb982f26eab165a327b4ad72046f9eb4024e..ec20f9bc36953c2f73ef9ff3d5973fe866cb9b62 100644
> --- a/src/ldap_helper.c
> +++ b/src/ldap_helper.c
> @@ -2964,9 +2964,10 @@ ldap_get_zone_serial(ldap_instance_t *inst, dns_name_t *zone_name,
>  
>  	CHECK(zr_get_zone_ptr(inst->zone_register, zone_name, &zone));
>  	CHECK(dns_zone_getserial2(zone, serial));
> -	dns_zone_detach(&zone);
>  
>  cleanup:
> +	if (zone != NULL)
> +		dns_zone_detach(&zone);
>  	return result;
>  }
>  
> -- 
> 1.7.11.4
> 


-- 
Adam Tkac, Red Hat, Inc.




More information about the Freeipa-devel mailing list