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 7f9e786caf4f4a27a4cf549928ff1b5d5737c8d9..f5830dacd0ce98836380bd89dcc5a28cc29cbd45 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));
        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)
        ret = afs_event(AUDIO_FILE_ADD, &aca->pbout, aft_row);
 out:
        if (ret < 0)