diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2002-10-25 02:37:11 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2002-10-25 02:37:11 +0000 |
commit | bea0b200c8e5b5adf1e7e28a6998b4c4fa7a22c4 (patch) | |
tree | 2c7d5c91c8be876b0964ccf031cfde3339f15797 /source3 | |
parent | 5b90fdc6bbe230cd676712c4de11b6dd78d8cb25 (diff) | |
download | samba-bea0b200c8e5b5adf1e7e28a6998b4c4fa7a22c4.tar.gz samba-bea0b200c8e5b5adf1e7e28a6998b4c4fa7a22c4.tar.bz2 samba-bea0b200c8e5b5adf1e7e28a6998b4c4fa7a22c4.zip |
Fix memory leak (patch by Steve Langasek)
(This used to be commit 06362586cb754bd6bc89b50b966737958286ca2e)
Diffstat (limited to 'source3')
-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 80e55454ef..0a42c36ea0 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -1508,6 +1508,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) { @@ -1536,6 +1549,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; |