]> git.samba.org - samba.git/commitdiff
r21508: Fix memleak in new idmap_tdb, thanks Herb.
authorSimo Sorce <idra@samba.org>
Thu, 22 Feb 2007 21:59:54 +0000 (21:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:09 +0000 (12:18 -0500)
Jerry please check.

Simo.
(This used to be commit a5354aa9a0bd860500356f45d09fce3d01649c60)

source3/nsswitch/idmap_tdb.c

index ef004daa3e279e8425bed1834b5a56f2a5dd53ab..c21c066fea1f58037ac813579276101703a3ca27 100644 (file)
@@ -1049,19 +1049,11 @@ static NTSTATUS idmap_tdb_remove_mapping(struct idmap_domain *dom, const struct
 
        /* Delete previous mappings. */
        
-       data = tdb_fetch(ctx->tdb, ksid);
-       if (data.dptr) {
-               DEBUG(10, ("Deleting existing mapping %s -> %s\n", ksid.dptr, kid.dptr ));
-               tdb_delete(ctx->tdb, ksid);
-               SAFE_FREE(data.dptr);
-       }
+       DEBUG(10, ("Deleting existing mapping %s -> %s\n", ksid.dptr, kid.dptr ));
+       tdb_delete(ctx->tdb, ksid);
 
-       data = tdb_fetch(ctx->tdb, kid);
-       if (data.dptr) {
-               DEBUG(10,("Deleting existing mapping %s -> %s\n", kid.dptr, ksid.dptr ));
-               tdb_delete(ctx->tdb, kid);
-               SAFE_FREE(data.dptr);
-       }
+       DEBUG(10,("Deleting existing mapping %s -> %s\n", kid.dptr, ksid.dptr ));
+       tdb_delete(ctx->tdb, kid);
 
        tdb_chainunlock(ctx->tdb, ksid);
        ret = NT_STATUS_OK;