diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-31 12:38:41 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-31 14:30:38 +1000 |
commit | efec5a9299455bd53cc770f2bc364f9a6f4f8def (patch) | |
tree | 55986b6ad3751fa4b3d0f48962638a8fcc2f261b /source4 | |
parent | a5d57a04c2e515212cc1f2b51c9a02acb33a79ba (diff) | |
download | samba-efec5a9299455bd53cc770f2bc364f9a6f4f8def.tar.gz samba-efec5a9299455bd53cc770f2bc364f9a6f4f8def.tar.bz2 samba-efec5a9299455bd53cc770f2bc364f9a6f4f8def.zip |
s4-libnet: Fix memory leak of lsa_RefDomainList and lsa_String onto libnet_ctx
These are only needed for as long as the call, and should be children of the
private context.
This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>. Thanks Ricky!
Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libnet/libnet_lookup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index 31ac6e4c10..cf2d70c41d 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -308,7 +308,7 @@ static bool prepare_lookup_params(struct libnet_context *ctx, s->sids.count = 0; s->sids.sids = NULL; - s->names = talloc_array(ctx, struct lsa_String, single_name); + s->names = talloc_array(s, struct lsa_String, single_name); if (composite_nomem(s->names, c)) return false; s->names[0].string = s->name; @@ -320,7 +320,7 @@ static bool prepare_lookup_params(struct libnet_context *ctx, s->lookup.in.count = &s->count; s->lookup.out.count = &s->count; s->lookup.out.sids = &s->sids; - s->lookup.out.domains = talloc_zero(ctx, struct lsa_RefDomainList *); + s->lookup.out.domains = talloc_zero(s, struct lsa_RefDomainList *); if (composite_nomem(s->lookup.out.domains, c)) return false; return true; |