WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 9eaa170

Browse files
Merge pull request #286 from NLnetLabs/bugfix/amtrelay-nogateway-relay
Fix RR Type AMTRELAY type nogateway
2 parents bb9a43b + 590e44f commit 9eaa170

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
when an already existing RR is tried to be added. This is a API
2323
change, hence this also bumps the version to 1.9.0
2424
* PR #282: ensure returning pkt with LDNS_STATUS_OK. Thanks grobian.
25+
* PR #286: Fix RR Type AMTRELAY type nogateway, to print relay '.',
26+
and memory leaks in parsing it.
2527

2628
1.8.4 2024-07-19
2729
* Fix building documentation in build directory.

host2str.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,8 @@ ldns_rdf2buffer_str_amtrelay(ldns_buffer *output, const ldns_rdf *rdf)
14221422
precedence, discovery_optional, relay_type);
14231423
if (relay)
14241424
(void) ldns_rdf2buffer_str(output, relay);
1425+
else
1426+
ldns_buffer_printf(output, ".");
14251427

14261428
ldns_rdf_deep_free(relay);
14271429
return ldns_buffer_status(output);

str2host.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,7 @@ ldns_str2rdf_amtrelay(ldns_rdf **rd, const char *str)
18301830
LDNS_FREE(relay);
18311831
LDNS_FREE(token);
18321832
ldns_buffer_free(str_buf);
1833+
ldns_rdf_deep_free(relay_rdf);
18331834
return LDNS_STATUS_INVALID_STR;
18341835
}
18351836

@@ -1845,7 +1846,7 @@ ldns_str2rdf_amtrelay(ldns_rdf **rd, const char *str)
18451846
LDNS_FREE(relay);
18461847
LDNS_FREE(token);
18471848
ldns_buffer_free(str_buf);
1848-
if (relay_rdf) ldns_rdf_free(relay_rdf);
1849+
ldns_rdf_deep_free(relay_rdf);
18491850
return LDNS_STATUS_MEM_ERR;
18501851
}
18511852

@@ -1864,7 +1865,7 @@ ldns_str2rdf_amtrelay(ldns_rdf **rd, const char *str)
18641865
LDNS_FREE(relay);
18651866
LDNS_FREE(token);
18661867
ldns_buffer_free(str_buf);
1867-
ldns_rdf_free(relay_rdf);
1868+
ldns_rdf_deep_free(relay_rdf);
18681869
LDNS_FREE(data);
18691870
if(!*rd) return LDNS_STATUS_MEM_ERR;
18701871
return LDNS_STATUS_OK;

zone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, const ldns_rdf *origin,
350350
ldns_rdf_deep_free(my_prev);
351351
}
352352
if (newzone) {
353-
ldns_zone_free(newzone);
353+
ldns_zone_deep_free(newzone);
354354
}
355355
return ret;
356356
}

0 commit comments

Comments
 (0)