This way it is more similar to free(3) and related functions. It
also allows to replace two checks in mp3_afh.c by a single check
in free_tag().
static void free_tag(struct id3_tag *id3_t)
{
int i, j;
+
+ if (!id3_t)
+ return;
for (i = 0; i < id3_t->nframes; i++) {
struct id3_frame *fr = id3_t->frames[i];
for (j = 0; j < fr->nfields; j++) {
ret = write_all(fd, (char *)v1_buffer, 128);
}
out:
- if (v1_tag)
- free_tag(v1_tag);
- if (v2_tag)
- free_tag(v2_tag);
+ free_tag(v1_tag);
+ free_tag(v2_tag);
return ret;
}