summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2009-03-02 11:54:55 -0500
committerMartin Nagy <mnagy@redhat.com>2009-03-02 18:31:59 +0100
commitdf3f8878f43820f9d801fbfd57298121785500d0 (patch)
tree84303456ee6e89961d13a0951e92b62d34bec360
parent2e0021dc5ba499ddbdcb898a50adaccf90032cda (diff)
Check return value from dns_name_fromtext. Free zone name only if it was allocated.
-rw-r--r--ldap_convert.c3
-rw-r--r--ldap_helper.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/ldap_convert.c b/ldap_convert.c
index 63f1e25..4c41454 100644
--- a/ldap_convert.c
+++ b/ldap_convert.c
@@ -95,7 +95,8 @@ dn_to_dnsname(isc_mem_t *mctx, const char *dn, const char *root_dn,
dns_name_init(&tmp_name, NULL);
dns_name_setbuffer(&tmp_name, &target_buffer);
- dns_name_fromtext(&tmp_name, &source_buffer, dns_rootname, 0, NULL);
+ CHECK(dns_name_fromtext(&tmp_name, &source_buffer, dns_rootname, 0,
+ NULL));
cleanup:
if (result != ISC_R_FAILURE)
diff --git a/ldap_helper.c b/ldap_helper.c
index fa3e337..baeac04 100644
--- a/ldap_helper.c
+++ b/ldap_helper.c
@@ -486,7 +486,8 @@ add_or_modify_zone(ldap_db_t *ldap_db, const char *dn, const char *db_name,
*/
cleanup:
- dns_name_free(&name, ldap_db->mctx);
+ if (dns_name_dynamic(&name))
+ dns_name_free(&name, ldap_db->mctx);
if (zone != NULL)
dns_zone_detach(&zone);