mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
Fix memory leak (patch by Steve Langasek)
(This used to be commit 299a9060e27d341658a7badbbb21401fbcc8f083)
This commit is contained in:
parent
12b1a63ceb
commit
48216962c4
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user