aft: Check return value of load_afsi().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Apr 2017 20:54:36 +0000 (22:54 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Apr 2017 20:59:10 +0000 (22:59 +0200)
This function should never fail, but it does return an error code and
all callers except copy_selector_info() check the return value. So
let's add the check there as well.

aft.c

diff --git a/aft.c b/aft.c
index bfcd1fb..1afc16b 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2272,7 +2272,9 @@ static int copy_selector_info(__a_unused struct osl_table *table,
        ret = get_afsi_object_of_row(row, &target_afsi_obj);
        if (ret < 0)
                return ret;
-       load_afsi(&target_afsi, &target_afsi_obj);
+       ret = load_afsi(&target_afsi, &target_afsi_obj);
+       if (ret < 0)
+               return ret;
        old_afsi = target_afsi;
        if (cad->flags & CPSI_FLAG_COPY_LYRICS_ID)
                target_afsi.lyrics_id = cad->source_afsi.lyrics_id;