pull one component of a dns/nbt string
*/
static enum ndr_err_code ndr_pull_component(struct ndr_pull *ndr,
- TALLOC_CTX *mem_ctx,
uint8_t **component,
uint32_t *offset,
uint32_t *max_offset,
"length too long",
err_name);
}
- *component = (uint8_t*)talloc_strndup(mem_ctx,
+ *component = (uint8_t*)talloc_strndup(ndr,
(const char *)&ndr->data[1 + *offset], len);
NDR_ERR_HAVE_NO_MEMORY(*component);
*offset += len + 1;
unsigned num_components;
char *name;
const char *err_name = NULL;
- TALLOC_CTX *mem_ctx = NULL;
if (is_nbt) {
err_name = "NBT";
- mem_ctx = ndr->current_mem_ctx;
} else {
err_name = "DNS";
- mem_ctx = ndr;
}
if (!(ndr_flags & NDR_SCALARS)) {
num_components++) {
uint8_t *component = NULL;
NDR_CHECK(ndr_pull_component(ndr,
- mem_ctx,
&component, &offset,
&max_offset,
err_name));
component);
}
NDR_ERR_HAVE_NO_MEMORY(name);
+ TALLOC_FREE(component);
}
if (num_components == MAX_COMPONENTS) {
return ndr_pull_error(ndr, NDR_ERR_STRING,