diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2002-10-25 02:35:44 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2002-10-25 02:35:44 +0000 |
commit | 48216962c4bd2ca71d1900d11d6f4d5e7de83b80 (patch) | |
tree | cfec83b1b4743040f11609f6c6176d72581dce55 /source3/passdb | |
parent | 12b1a63cebe1e8942ea1d61dcce98184f401d39f (diff) | |
download | samba-48216962c4bd2ca71d1900d11d6f4d5e7de83b80.tar.gz samba-48216962c4bd2ca71d1900d11d6f4d5e7de83b80.tar.bz2 samba-48216962c4bd2ca71d1900d11d6f4d5e7de83b80.zip |
Fix memory leak (patch by Steve Langasek)
(This used to be commit 299a9060e27d341658a7badbbb21401fbcc8f083)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/pdb_nisplus.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c index de520b6b14..0694d3b159 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -1507,6 +1507,19 @@ static nis_result *nisp_get_nis_list (const char *nisname, unsigned int flags) return result; } +static void free_private_data(void **vp) +{ + struct nisplus_private_info **private = (struct nisplus_private_info **)vp; + + if ((*private)->result) { + nis_freeresult ((*private)->result); + } + + free(*private); + + /* No need to free any further, as it is talloc()ed */ +} + NTSTATUS pdb_init_nisplussam (PDB_CONTEXT * pdb_context, PDB_METHODS ** pdb_method, const char *location) { @@ -1535,6 +1548,7 @@ NTSTATUS pdb_init_nisplussam (PDB_CONTEXT * pdb_context, (*pdb_method)->add_sam_account = nisplussam_add_sam_account; (*pdb_method)->update_sam_account = nisplussam_update_sam_account; (*pdb_method)->delete_sam_account = nisplussam_delete_sam_account; + (*pdb_method)->free_private_data = free_private_data; (*pdb_method)->private_data = private; return NT_STATUS_OK; |