aft.c: Fix a possible memory leak.
authorAndre Noll <maan@systemlinux.org>
Sat, 3 Nov 2007 21:00:16 +0000 (22:00 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 3 Nov 2007 21:00:16 +0000 (22:00 +0100)
aft.c

diff --git a/aft.c b/aft.c
index 6010d5d..9fca561 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -733,9 +733,9 @@ int open_and_update_audio_file(struct osl_row *aft_row,
        aced.old_afsi = &old_afsi;
        afs_event(AFSI_CHANGE, NULL, &aced);
        ret = save_afd(afd);
+       free(afd->afhi.chunk_table);
        if (ret < 0)
                goto err;
-       free(afd->afhi.chunk_table);
 err:
        osl_close_disk_object(&chunk_table_obj);
        return ret;