The latter is only called by the former, and both are short enough.
Don't bother to zero out meta->tags and meta->count because we free
the containing mp4 structure as well.
return f;
}
-static int32_t tag_delete(struct mp4_metadata *meta)
-{
- uint32_t i;
-
- for (i = 0; i < meta->count; i++) {
- free(meta->tags[i].item);
- free(meta->tags[i].value);
- }
- free(meta->tags);
- meta->tags = NULL;
- meta->count = 0;
-
- return 0;
-}
-
void mp4_close(struct mp4 *f)
{
int32_t i;
free(f->track[i]);
}
}
-
- tag_delete(&(f->meta));
+ for (i = 0; i < f->meta.count; i++) {
+ free(f->meta.tags[i].item);
+ free(f->meta.tags[i].value);
+ }
+ free(f->meta.tags);
free(f);
}