diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-27 01:36:19 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2004-09-27 01:36:19 +0000 |
commit | 5d9657b67d5871733d0182bf3769c399ddfd86d7 (patch) | |
tree | 7eea0b43653200bee0daea0f9d20c09b99cf9860 /source/rpc_server/epmapper | |
parent | c0c6ee5891152fc6d16dadd18a5c3515065bfa7e (diff) | |
download | samba-5d9657b67d5871733d0182bf3769c399ddfd86d7.tar.gz samba-5d9657b67d5871733d0182bf3769c399ddfd86d7.tar.xz samba-5d9657b67d5871733d0182bf3769c399ddfd86d7.zip |
r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
Diffstat (limited to 'source/rpc_server/epmapper')
-rw-r--r-- | source/rpc_server/epmapper/rpc_epmapper.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/rpc_server/epmapper/rpc_epmapper.c b/source/rpc_server/epmapper/rpc_epmapper.c index 37f1c372e08..54a996e82a9 100644 --- a/source/rpc_server/epmapper/rpc_epmapper.c +++ b/source/rpc_server/epmapper/rpc_epmapper.c @@ -123,13 +123,14 @@ static uint32_t build_ep_list(TALLOC_CTX *mem_ctx, struct dcesrv_endpoint *d; uint32_t total = 0; - (*eps) = talloc(mem_ctx, 0); - + *eps = NULL; + for (d=endpoint_list; d; d=d->next) { struct dcesrv_if_list *iface; for (iface=d->interface_list;iface;iface=iface->next) { - (*eps) = talloc_realloc_p(*eps, + (*eps) = talloc_realloc_p(mem_ctx, + *eps, struct dcesrv_ep_iface, total + 1); if (!*eps) { |