ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
status = push(ndr, NDR_SCALARS|NDR_BUFFERS, p);
if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(ndr);
return 0;
}
ret = ndr->offset;
ndr = ndr_push_init_ctx(NULL);
if (!ndr) return 0;
ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
- ndr_push_set_switch_value(ndr, p, level);
+
+ status = ndr_push_set_switch_value(ndr, p, level);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(ndr);
+ return 0;
+ }
status = push(ndr, NDR_SCALARS|NDR_BUFFERS, p);
if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(ndr);
return 0;
}
ret = ndr->offset;