mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
Try to fix memory leaks found by valgrind in pdb_ldap code.
Andrew Bartlett
(This used to be commit decadfcc82
)
This commit is contained in:
parent
1079bd40c5
commit
ed9c090737
@ -2288,6 +2288,7 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
|
||||
DEBUG(4,
|
||||
("Unable to locate SID [%s] count=%d\n", sid_to_string(sid_string, sid),
|
||||
count));
|
||||
ldap_msgfree(result);
|
||||
return NT_STATUS_NO_SUCH_USER;
|
||||
}
|
||||
else if (count > 1)
|
||||
@ -2295,6 +2296,7 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
|
||||
DEBUG(1,
|
||||
("More than one user with SID [%s]. Failing. count=%d\n", sid_to_string(sid_string, sid),
|
||||
count));
|
||||
ldap_msgfree(result);
|
||||
return NT_STATUS_NO_SUCH_USER;
|
||||
}
|
||||
|
||||
@ -2306,11 +2308,9 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
|
||||
ldap_msgfree(result);
|
||||
return NT_STATUS_NO_SUCH_USER;
|
||||
}
|
||||
ldap_msgfree(result);
|
||||
ret = NT_STATUS_OK;
|
||||
} else {
|
||||
ldap_msgfree(result);
|
||||
}
|
||||
ldap_msgfree(result);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user