1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

- check return value of ndr_push_set_switch_value()

- fix memory leaks in error pathes

metze

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25798 0c0555d6-39d7-0310-84fc-f1cc0bd64818
This commit is contained in:
metze
2007-11-02 11:01:18 +00:00
committed by Stefan Metzmacher
parent 55d01b3f5b
commit a0d0a06a9e

View File

@ -806,6 +806,7 @@ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
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;
@ -828,9 +829,15 @@ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_f
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;