aft.c: Check for osl errors in com_add_callback().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 22 Dec 2015 15:36:45 +0000 (15:36 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Dec 2015 19:06:31 +0000 (19:06 +0000)
We only want to issue the afs event if the row was successfully added
to the audio file table.

aft.c

diff --git a/aft.c b/aft.c
index 7f9e786..f5830da 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1745,6 +1745,8 @@ static int com_add_callback(struct afs_callback_arg *aca)
        objs[AFTCOL_AFSI].size = AFSI_SIZE;
        save_afsi(&default_afsi, &objs[AFTCOL_AFSI]);
        ret = osl(osl_add_and_get_row(audio_file_table, objs, &aft_row));
+       if (ret < 0)
+               goto out;
        ret = afs_event(AUDIO_FILE_ADD, &aca->pbout, aft_row);
 out:
        if (ret < 0)