diff options
author | Tim Potter <tpot@samba.org> | 2001-05-15 01:55:29 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-05-15 01:55:29 +0000 |
commit | b343f082e4802aa1eff747b24f427644332f0380 (patch) | |
tree | 4c35ac035387d91fe7d8bb967e28d20f131ab21b /source3 | |
parent | b10ae68700e7642c237deaa8fd11da36694e7384 (diff) | |
download | samba-b343f082e4802aa1eff747b24f427644332f0380.tar.gz samba-b343f082e4802aa1eff747b24f427644332f0380.tar.bz2 samba-b343f082e4802aa1eff747b24f427644332f0380.zip |
Memory leak fixes from insure.
(This used to be commit 03b1cab9a80264f0c940c45d0557ef7efe685095)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nsswitch/winbindd_glue.c | 5 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/source3/nsswitch/winbindd_glue.c b/source3/nsswitch/winbindd_glue.c index 3c789d5a7c..71b802b68d 100644 --- a/source3/nsswitch/winbindd_glue.c +++ b/source3/nsswitch/winbindd_glue.c @@ -42,6 +42,8 @@ BOOL wb_lsa_open_policy(char *server, BOOL sec_qos, uint32 des_access, pol->cli = (struct cli_state *)malloc(sizeof(struct cli_state)); pol->mem_ctx = talloc_init(); + ZERO_STRUCTP(pol->cli); + if (!pol->cli || !pol->mem_ctx) return False; @@ -183,6 +185,9 @@ BOOL wb_samr_connect(char *server, uint32 access_mask, CLI_POLICY_HND *pol) ZERO_STRUCTP(pol); pol->cli = (struct cli_state *)malloc(sizeof(struct cli_state)); + + ZERO_STRUCTP(pol->cli); + pol->mem_ctx = talloc_init(); if (!pol->cli || !pol->mem_ctx) diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 4343f859ed..03f9ee13cb 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -530,11 +530,6 @@ BOOL winbindd_lookup_sid_by_name(char *name, DOM_SID *sid, } } - /* Free memory */ - - if (types != NULL) free(types); - if (sids != NULL) free(sids); - return res; } @@ -570,11 +565,6 @@ BOOL winbindd_lookup_name_by_sid(DOM_SID *sid, fstring name, } } - /* Free memory */ - - safe_free(types); - free_char_array(num_names, names); - return res; } |