diff options
author | Simo Sorce <idra@samba.org> | 2007-02-22 21:59:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:09 -0500 |
commit | fa5e0a238c999cbea5d57363db2cd0cbf9fffb86 (patch) | |
tree | 46ac549eb9560e6a26f5ef47e3125bbc5317382b | |
parent | 2b52e35770270959d5029fa84932d436652c7193 (diff) | |
download | samba-fa5e0a238c999cbea5d57363db2cd0cbf9fffb86.tar.gz samba-fa5e0a238c999cbea5d57363db2cd0cbf9fffb86.tar.bz2 samba-fa5e0a238c999cbea5d57363db2cd0cbf9fffb86.zip |
r21508: Fix memleak in new idmap_tdb, thanks Herb.
Jerry please check.
Simo.
(This used to be commit a5354aa9a0bd860500356f45d09fce3d01649c60)
-rw-r--r-- | source3/nsswitch/idmap_tdb.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source3/nsswitch/idmap_tdb.c b/source3/nsswitch/idmap_tdb.c index ef004daa3e..c21c066fea 100644 --- a/source3/nsswitch/idmap_tdb.c +++ b/source3/nsswitch/idmap_tdb.c @@ -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; |