isc_uint32_t i;
REQUIRE(ipkl != NULL);
- REQUIRE(ipkl->addrs != NULL);
- REQUIRE(ipkl->keys != NULL);
+ REQUIRE(ipkl->count == 0 || ipkl->keys != NULL);
if (ipkl->count == 0)
return;
- isc_mem_put(mctx, ipkl->addrs, ipkl->count * sizeof(isc_sockaddr_t));
+ if (ipkl != NULL)
+ isc_mem_put(mctx, ipkl->addrs,
+ ipkl->count * sizeof(isc_sockaddr_t));
+
if (ipkl->dscps != NULL)
isc_mem_put(mctx, ipkl->dscps,
ipkl->count * sizeof(isc_dscp_t));
+
for (i = 0; i < ipkl->count; i++) {
if (ipkl->keys[i] == NULL)
continue;
dns_name_free(ipkl->keys[i], mctx);
isc_mem_put(mctx, ipkl->keys[i], sizeof(dns_name_t));
}
+
isc_mem_put(mctx, ipkl->keys, ipkl->count * sizeof(dns_name_t *));
+
ipkl->count = 0;
ipkl->addrs = NULL;
ipkl->dscps = NULL;
*/
REQUIRE(b->length <= length);
REQUIRE(base != NULL);
- REQUIRE(b->autore = ISC_FALSE);
+ REQUIRE(!b->autore);
(void)memmove(base, b->base, b->length);
b->base = base;
isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val) {
isc_result_t result;
REQUIRE(ISC_BUFFER_VALID(b));
- if (b->autore == ISC_TRUE) {
+ if (b->autore) {
result = isc_buffer_reserve(&b, 4);
REQUIRE(result == ISC_R_SUCCESS);
}
isc_uint32_t vallo;
REQUIRE(ISC_BUFFER_VALID(b));
- if (b->autore == ISC_TRUE) {
+ if (b->autore) {
result = isc_buffer_reserve(&b, 6);
REQUIRE(result == ISC_R_SUCCESS);
}
{
isc_result_t result;
REQUIRE(ISC_BUFFER_VALID(b));
- if (b->autore == ISC_TRUE) {
+ if (b->autore) {
result = isc_buffer_reserve(&b, length);
REQUIRE(result == ISC_R_SUCCESS);
}
* Do not use ISC__BUFFER_PUTSTR(), so strlen is only done once.
*/
l = strlen(source);
- if (b->autore == ISC_TRUE) {
+ if (b->autore) {
result = isc_buffer_reserve(&b, l);
REQUIRE(result == ISC_R_SUCCESS);
}