s3:passdb Fix memory leak
authorSimo Sorce <ssorce@redhat.com>
Sat, 29 May 2010 13:48:20 +0000 (09:48 -0400)
committerSimo Sorce <ssorce@redhat.com>
Sat, 29 May 2010 14:54:08 +0000 (10:54 -0400)
We were allocating this passwd structure on sampass, but never freeing
it nor assigning it to unix_pw where it could be reused.

source3/passdb/pdb_get_set.c

index 96f6b40b2dd9d687879ab1c33d25b01d8391b8da..57d95138e3ea99b4c969324afdd853d50bd8a38d 100644 (file)
@@ -206,6 +206,7 @@ const struct dom_sid *pdb_get_group_sid(struct samu *sampass)
                pwd = sampass->unix_pw;
        } else {
                pwd = Get_Pwnam_alloc( sampass, pdb_get_username(sampass) );
+               sampass->unix_pw = pwd;
        }
 
        if ( !pwd ) {