]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afh_common.c
Introduce clear_afhi().
[paraslash.git] / afh_common.c
index 9f1d1881e2e88043eeb7bafce6477676e8fc2076..5b6301b5f3d06405930df8fbcc64c7095f7ece06 100644 (file)
@@ -221,6 +221,26 @@ success:
        return ret;
 }
 
+/**
+ * Deallocate contents of a filled-in ahi structure
+ *
+ * \param afhi The structure to clear.
+ *
+ * The given pointer is kept, everything else is freed.
+ */
+void clear_afhi(struct afh_info *afhi)
+{
+       if (!afhi)
+               return;
+       free(afhi->chunk_table);
+       free(afhi->techinfo);
+       free(afhi->tags.artist);
+       free(afhi->tags.title);
+       free(afhi->tags.year);
+       free(afhi->tags.album);
+       free(afhi->tags.comment);
+}
+
 /**
  * Get the name of the given audio format.
  *