svn commit: samba r3872 - in trunk/source/passdb: .
Richard Sharpe
rsharpe at richardsharpe.com
Fri Nov 19 22:37:47 GMT 2004
On Fri, 19 Nov 2004 vlendec at samba.org wrote:
> Author: vlendec
> Date: 2004-11-19 12:00:23 +0000 (Fri, 19 Nov 2004)
> New Revision: 3872
>
> Log:
> Fix memleak
> Modified:
> trunk/source/passdb/pdb_ldap.c
>
>
> Changeset:
> Modified: trunk/source/passdb/pdb_ldap.c
> ===================================================================
> --- trunk/source/passdb/pdb_ldap.c 2004-11-19 11:59:56 UTC (rev 3871)
> +++ trunk/source/passdb/pdb_ldap.c 2004-11-19 12:00:23 UTC (rev 3872)
> @@ -2263,7 +2263,7 @@
> struct smbldap_state *conn = ldap_state->smbldap_state;
> pstring filter;
> char *attrs[] = { "gidNumber", "sambaSID", NULL };
> - char *escape_name = escape_ldap_string_alloc(username);
> + char *escape_name;
> int rc;
> LDAPMessage *msg = NULL;
> LDAPMessage *entry;
> @@ -2279,6 +2279,8 @@
> *sids = NULL;
> num_sids = 0;
>
> + escape_name = escape_ldap_string_alloc(username);
> +
> if (escape_name == NULL)
> return NT_STATUS_UNSUCCESSFUL;
Hmmm, how does that fix a mem leak? You have just moved the code around a
bit.
Secondly, shouldn't that return status be NT_STATUS_NOMEM or whatever the
Windows out of mem code is? Actually, NT_STATUS_NO_MEMORY?
Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org,
sharpe[at]ethereal.com, http://www.richardsharpe.com
More information about the samba-technical
mailing list