]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
aft.c: Don't call osl_close_disk_object() on failure.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 21 Dec 2014 14:35:19 +0000 (14:35 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 11 Jan 2015 14:56:00 +0000 (15:56 +0100)
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

diff --git a/aft.c b/aft.c
index df34fa145faed3281bb373c03b52db1b64800400..61fd9942242760ca7d244cf688787870bf4b0268 100644 (file)
--- 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)