summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-15 01:55:29 +0000
committerTim Potter <tpot@samba.org>2001-05-15 01:55:29 +0000
commitb343f082e4802aa1eff747b24f427644332f0380 (patch)
tree4c35ac035387d91fe7d8bb967e28d20f131ab21b
parentb10ae68700e7642c237deaa8fd11da36694e7384 (diff)
downloadsamba-b343f082e4802aa1eff747b24f427644332f0380.tar.gz
samba-b343f082e4802aa1eff747b24f427644332f0380.tar.xz
samba-b343f082e4802aa1eff747b24f427644332f0380.zip
Memory leak fixes from insure.
(This used to be commit 03b1cab9a80264f0c940c45d0557ef7efe685095)
-rw-r--r--source3/nsswitch/winbindd_glue.c5
-rw-r--r--source3/nsswitch/winbindd_util.c10
2 files changed, 5 insertions, 10 deletions
diff --git a/source3/nsswitch/winbindd_glue.c b/source3/nsswitch/winbindd_glue.c
index 3c789d5a7c8..71b802b68d0 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 4343f859ed3..03f9ee13cb0 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;
}