Author: jerry
Date: 2007-03-01 05:52:38 +0000 (Thu, 01 Mar 2007)
New Revision: 21626

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21626

Log:
Fix memory leak on error path noticed by 
SATOH Fumiyasu <[EMAIL PROTECTED]>

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c    2007-03-01 
05:45:45 UTC (rev 21625)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c    2007-03-01 
05:52:38 UTC (rev 21626)
@@ -517,6 +517,7 @@
        if ((mlock(memcredp->nt_hash, memcredp->len)) == -1) {
                DEBUG(0,("failed to mlock memory: %s (%d)\n", 
                        strerror(errno), errno));
+               SAFE_FREE(memcredp->nt_hash);
                return map_nt_error_from_unix(errno);
        }
 

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c 2007-03-01 
05:45:45 UTC (rev 21625)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c 2007-03-01 
05:52:38 UTC (rev 21626)
@@ -517,6 +517,7 @@
        if ((mlock(memcredp->nt_hash, memcredp->len)) == -1) {
                DEBUG(0,("failed to mlock memory: %s (%d)\n", 
                        strerror(errno), errno));
+               SAFE_FREE(memcredp->nt_hash);
                return map_nt_error_from_unix(errno);
        }
 

Reply via email to