mirror of https://github.com/getdnsapi/getdns.git
Some guards and make example_all_functions at least run
This commit is contained in:
parent
6289e2cad9
commit
31e7bf1a8a
|
@ -660,6 +660,10 @@ getdns_pretty_print_dict(struct getdns_dict *dict)
|
|||
ldns_buffer *buf;
|
||||
char *ret;
|
||||
|
||||
if (!dict) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf = ldns_buffer_new(100);
|
||||
if (! buf)
|
||||
return NULL;
|
||||
|
|
|
@ -89,10 +89,6 @@ retregular = getdns_context_create(
|
|||
boolarg
|
||||
);
|
||||
|
||||
getdns_context_destroy(
|
||||
contextarg
|
||||
);
|
||||
|
||||
retregular = getdns_cancel_callback(
|
||||
contextarg,
|
||||
txidarg
|
||||
|
@ -150,18 +146,19 @@ retregular = getdns_dict_get_bindata(dictarg, charstararg, bindataptrarg);
|
|||
retregular = getdns_dict_get_int(dictarg, charstararg, uint32ptrarg);
|
||||
|
||||
listarg = getdns_list_create();
|
||||
getdns_list_destroy(listarg);
|
||||
retregular = getdns_list_set_dict(listarg, sizetarg, dictarg);
|
||||
retregular = getdns_list_set_list(listarg, sizetarg, listarg);
|
||||
retregular = getdns_list_set_bindata(listarg, sizetarg, bindataarg);
|
||||
retregular = getdns_list_set_int(listarg, sizetarg, uint32arg);
|
||||
|
||||
dictarg = getdns_dict_create();
|
||||
getdns_dict_destroy(dictarg);
|
||||
retregular = getdns_dict_set_dict(dictarg, charstararg, dictarg);
|
||||
retregular = getdns_dict_set_list(dictarg, charstararg, listarg);
|
||||
retregular = getdns_dict_set_bindata(dictarg, charstararg, bindataarg);
|
||||
retregular = getdns_dict_set_int(dictarg, charstararg, uint32arg);
|
||||
retcharstar = getdns_pretty_print_dict(
|
||||
dictarg
|
||||
);
|
||||
|
||||
retcharstar = getdns_convert_fqdn_to_dns_name(
|
||||
charstararg
|
||||
|
@ -185,10 +182,6 @@ retregular = getdns_validate_dnssec(
|
|||
listarg
|
||||
);
|
||||
|
||||
retcharstar = getdns_pretty_print_dict(
|
||||
dictarg
|
||||
);
|
||||
|
||||
retcharstar = getdns_display_ip_address(
|
||||
bindataarg
|
||||
);
|
||||
|
@ -294,4 +287,8 @@ retregular = getdns_context_set_memory_reallocator(
|
|||
deallocfunctionarg
|
||||
);
|
||||
|
||||
getdns_list_destroy(listarg);
|
||||
getdns_dict_destroy(dictarg);
|
||||
getdns_context_destroy(contextarg);
|
||||
|
||||
return(0); } /* End of main() */
|
||||
|
|
|
@ -201,6 +201,10 @@ getdns_general_ub(struct ub_ctx* unbound,
|
|||
getdns_return_t gr;
|
||||
int r;
|
||||
|
||||
if (!name) {
|
||||
return GETDNS_RETURN_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
gr = getdns_context_prepare_for_resolution(context);
|
||||
if (gr != GETDNS_RETURN_GOOD) {
|
||||
return GETDNS_RETURN_BAD_CONTEXT;
|
||||
|
|
Loading…
Reference in New Issue