On Fri, 19 Nov 2004 [EMAIL PROTECTED] 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

Reply via email to