r21421: Fix a memleak. This made tdb look considerably worse than necessary.
authorVolker Lendecke <vlendec@samba.org>
Sun, 18 Feb 2007 11:11:57 +0000 (11:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:48:30 +0000 (14:48 -0500)
Volker

source/torture/local/dbspeed.c

index 08012fc5e93bb6f315c345f72d49e64131e05388..2dce34348311761f1c590a4e6b62461d7ddf4406 100644 (file)
@@ -96,6 +96,7 @@ static BOOL test_tdb_speed(struct torture_context *torture, const void *_data)
                key.dptr = (uint8_t *)talloc_asprintf(tmp_ctx, "S-1-5-21-53173311-3623041448-2049097239-%u", i);
                key.dsize = strlen((char *)key.dptr)+1;
                data = tdb_fetch(tdbw->tdb, key);
+               talloc_free(key.dptr);
                if (data.dptr == NULL) {
                        torture_result(torture, TORTURE_FAIL, "Failed to fetch SID %d\n", i);
                        goto failed;
@@ -104,6 +105,7 @@ static BOOL test_tdb_speed(struct torture_context *torture, const void *_data)
                key.dptr = (uint8_t *)talloc_asprintf(tmp_ctx, "UID %u", i);
                key.dsize = strlen((char *)key.dptr)+1;
                data = tdb_fetch(tdbw->tdb, key);
+               talloc_free(key.dptr);
                if (data.dptr == NULL) {
                        torture_result(torture, TORTURE_FAIL, "Failed to fetch UID %d\n", i);
                        goto failed;