Hello,

Prevent crash if working directory for zone cannot be created.

This patch should go to master branch before 4.0 release.

--
Petr^2 Spacek
From eb7b0c980f181bfffbb57aff8af44d13114eb4a4 Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Tue, 28 Jan 2014 15:55:57 +0100
Subject: [PATCH] Prevent crash if working directory for zone cannot be
 created.

---
 src/zone_register.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/zone_register.c b/src/zone_register.c
index f25c15b5d6581a7033345fb411a23f9c49937bcc..6a5bade031660b7fc567a36a074aff1c5fda2689 100644
--- a/src/zone_register.c
+++ b/src/zone_register.c
@@ -291,9 +291,12 @@ delete_zone_info(void *arg1, void *arg2)
 		return;
 
 	settings_set_free(&zinfo->settings);
-	isc_mem_free(mctx, zinfo->dn);
-	dns_zone_detach(&zinfo->zone);
-	dns_db_detach(&zinfo->ldapdb);
+	if (zinfo->dn != NULL)
+		isc_mem_free(mctx, zinfo->dn);
+	if (zinfo->zone != NULL)
+		dns_zone_detach(&zinfo->zone);
+	if (zinfo->ldapdb != NULL)
+		dns_db_detach(&zinfo->ldapdb);
 	SAFE_MEM_PUT_PTR(mctx, zinfo);
 }
 
-- 
1.8.3.1

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

Reply via email to