mirror of https://github.com/getdnsapi/getdns.git
memory leak fixes
This commit is contained in:
parent
51a04f8f6c
commit
a5bacfefcf
|
@ -2928,7 +2928,7 @@ getdns_root_trust_anchor(time_t *utc_date_of_anchor)
|
||||||
if (!_getdns_parse_ta_file(utc_date_of_anchor, gbuf))
|
if (!_getdns_parse_ta_file(utc_date_of_anchor, gbuf))
|
||||||
goto error_free_gbuf;
|
goto error_free_gbuf;
|
||||||
|
|
||||||
_getdns_wire2list( gldns_buffer_export(gbuf)
|
_getdns_wire2list( gldns_buffer_begin(gbuf)
|
||||||
, gldns_buffer_position(gbuf), ta_rrs);
|
, gldns_buffer_position(gbuf), ta_rrs);
|
||||||
|
|
||||||
gldns_buffer_free(gbuf);
|
gldns_buffer_free(gbuf);
|
||||||
|
|
|
@ -180,16 +180,15 @@ static getdns_return_t validate_chain(getdns_dict *response)
|
||||||
if (!(to_validate = getdns_list_create()))
|
if (!(to_validate = getdns_list_create()))
|
||||||
return GETDNS_RETURN_MEMORY_ERROR;
|
return GETDNS_RETURN_MEMORY_ERROR;
|
||||||
|
|
||||||
if (!(trust_anchor = getdns_root_trust_anchor(NULL)))
|
trust_anchor = getdns_root_trust_anchor(NULL);
|
||||||
return GETDNS_RETURN_GENERIC_ERROR;
|
|
||||||
|
|
||||||
if ((r = getdns_dict_get_list(
|
if ((r = getdns_dict_get_list(
|
||||||
response, "validation_chain", &validation_chain)))
|
response, "validation_chain", &validation_chain)))
|
||||||
return r;
|
goto error;
|
||||||
|
|
||||||
if ((r = getdns_dict_get_list(
|
if ((r = getdns_dict_get_list(
|
||||||
response, "replies_tree", &replies_tree)))
|
response, "replies_tree", &replies_tree)))
|
||||||
return r;
|
goto error;
|
||||||
|
|
||||||
fprintf(stdout, "replies_tree %zu, dnssec_status: ", i);
|
fprintf(stdout, "replies_tree %zu, dnssec_status: ", i);
|
||||||
switch ((s = getdns_validate_dnssec(
|
switch ((s = getdns_validate_dnssec(
|
||||||
|
@ -218,7 +217,7 @@ static getdns_return_t validate_chain(getdns_dict *response)
|
||||||
while (!(r = getdns_list_get_dict(replies_tree, i++, &reply))) {
|
while (!(r = getdns_list_get_dict(replies_tree, i++, &reply))) {
|
||||||
|
|
||||||
if ((r = getdns_list_set_dict(to_validate, 0, reply)))
|
if ((r = getdns_list_set_dict(to_validate, 0, reply)))
|
||||||
return r;
|
goto error;
|
||||||
|
|
||||||
fprintf( stdout
|
fprintf( stdout
|
||||||
, "reply %zu, dnssec_status: ", i);
|
, "reply %zu, dnssec_status: ", i);
|
||||||
|
@ -244,8 +243,11 @@ static getdns_return_t validate_chain(getdns_dict *response)
|
||||||
fprintf(stdout, "%d\n", (int)s);
|
fprintf(stdout, "%d\n", (int)s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (r != GETDNS_RETURN_NO_SUCH_LIST_ITEM)
|
if (r == GETDNS_RETURN_NO_SUCH_LIST_ITEM)
|
||||||
return r;
|
r = GETDNS_RETURN_GOOD;
|
||||||
|
error:
|
||||||
|
getdns_list_destroy(trust_anchor);
|
||||||
|
getdns_list_destroy(to_validate);
|
||||||
|
|
||||||
return GETDNS_RETURN_GOOD;
|
return GETDNS_RETURN_GOOD;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue