summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelte Jansen <jeltejan@NLnetLabs.nl>2006-04-10 11:16:46 +0200
committerJelte Jansen <jeltejan@NLnetLabs.nl>2006-04-10 11:16:46 +0200
commit503d8a47d63b6200809d29f0ebb4df570a2d420a (patch)
treec01edd59c7398357d9030d4468b4731be20f8d55
parent5b207c88417b027d6cb5f7b4c30f72578c6fe5ea (diff)
downloadldns-503d8a47d63b6200809d29f0ebb4df570a2d420a.tar.gz
memories
-rw-r--r--examples/ldns-keyfetcher.c2
-rw-r--r--rr.c3
-rw-r--r--zone.c5
3 files changed, 8 insertions, 2 deletions
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index c8a7859b..1567b2ab 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -521,7 +521,7 @@ read_root_hints(const char *filename)
ldns_rr_list_push_rr(addresses, ldns_rr_clone(rr));
}
}
- ldns_zone_free(z);
+ ldns_zone_deep_free(z);
return addresses;
}
}
diff --git a/rr.c b/rr.c
index f51793b3..158ab19e 100644
--- a/rr.c
+++ b/rr.c
@@ -296,7 +296,8 @@ ldns_rr_new_frm_str(ldns_rr **newrr, const char *str, uint16_t default_ttl, ldns
}
}
if (prev) {
- *prev = ldns_rr_owner(new);
+ ldns_rdf_deep_free(*prev);
+ *prev = ldns_rdf_clone(ldns_rr_owner(new));
}
}
}
diff --git a/zone.c b/zone.c
index 8131a45a..7d5b994b 100644
--- a/zone.c
+++ b/zone.c
@@ -182,6 +182,7 @@ ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, ldns_rdf *origin, uint16_t ttl,
while(!feof(fp)) {
s = ldns_rr_new_frm_fp_l(&rr, fp, &my_ttl, &my_origin, &my_prev, line_nr);
+printf("ALLOCED IN FP_L: %p\n", s);
switch (s) {
case LDNS_STATUS_OK:
if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
@@ -222,9 +223,13 @@ ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, ldns_rdf *origin, uint16_t ttl,
if (my_origin) {
ldns_rdf_deep_free(my_origin);
}
+ if (my_prev) {
+ ldns_rdf_deep_free(my_prev);
+ }
if (z) {
*z = newzone;
}
+
return LDNS_STATUS_OK;
}