From b6161b3a38321a3d6fb019f71f9a00d71e105f5d Mon Sep 17 00:00:00 2001
From: Andre Noll <maan@tuebingen.mpg.de>
Date: Sun, 21 Dec 2014 14:35:19 +0000
Subject: [PATCH] aft.c: Don't call osl_close_disk_object() on failure.

If osl_open_disk_object() fails, we branch to the "err" label where
osl_close_disk_object() is called although no disk object exists. Fix
this by simply returning the osl error code in this case.
---
 aft.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aft.c b/aft.c
index df34fa14..61fd9942 100644
--- a/aft.c
+++ b/aft.c
@@ -1109,7 +1109,7 @@ int open_and_update_audio_file(struct osl_row *aft_row, long score,
 	ret = osl(osl_open_disk_object(audio_file_table, aft_row,
 		AFTCOL_CHUNKS, &chunk_table_obj));
 	if (ret < 0)
-		goto err;
+		return ret;
 	ret = mmap_full_file(path, O_RDONLY, &map.data,
 		&map.size, &afd->fd);
 	if (ret < 0)
-- 
2.39.5