From dc1677b58e6df634ebed968b3ab3f72325300577 Mon Sep 17 00:00:00 2001 From: szaka Date: Sat, 2 Feb 2008 16:43:05 +0000 Subject: [PATCH] ntfs_index_lookup(): fix potential double free() on error paths --- libntfs-3g/index.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c index ec3b2c16..eb8a7476 100644 --- a/libntfs-3g/index.c +++ b/libntfs-3g/index.c @@ -668,7 +668,6 @@ int ntfs_index_lookup(const void *key, const int key_len, ntfs_index_context *ic INDEX_ROOT *ir; INDEX_ENTRY *ie; INDEX_BLOCK *ib = NULL; - ntfs_attr_search_ctx *actx; int ret, err = 0; ntfs_log_trace("Entering\n"); @@ -679,7 +678,7 @@ int ntfs_index_lookup(const void *key, const int key_len, ntfs_index_context *ic return -1; } - ir = ntfs_ir_lookup(ni, icx->name, icx->name_len, &actx); + ir = ntfs_ir_lookup(ni, icx->name, icx->name_len, &icx->actx); if (!ir) { if (errno == ENOENT) errno = EIO; @@ -718,7 +717,6 @@ int ntfs_index_lookup(const void *key, const int key_len, ntfs_index_context *ic goto err_out; } - icx->actx = actx; icx->ir = ir; if (ret != STATUS_KEEP_SEARCHING) { @@ -782,8 +780,6 @@ err_out: free(ib); if (!err) err = EIO; - if (actx) - ntfs_attr_put_search_ctx(actx); errno = err; return -1; done: