mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-12-04 14:46:31 -05:00
Sprinkle in some consistency ...
git-svn-id: https://svn.xiph.org/trunk/ezstream@13440 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
parent
3dd13ec7aa
commit
c8a98a5b72
@ -242,41 +242,39 @@ playlist_program(const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
playlist_free(playlist_t **pl)
|
playlist_free(playlist_t **pl_p)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
playlist_t *tmp;
|
playlist_t *pl;
|
||||||
|
|
||||||
if (pl == NULL || *pl == NULL)
|
if (pl_p == NULL || (pl = *pl_p) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tmp = *pl;
|
if (pl->filename != NULL) {
|
||||||
|
xfree(pl->filename);
|
||||||
if (tmp->filename != NULL) {
|
pl->filename = NULL;
|
||||||
xfree(tmp->filename);
|
|
||||||
tmp->filename = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp->list != NULL) {
|
if (pl->list != NULL) {
|
||||||
if (tmp->size > 0) {
|
if (pl->size > 0) {
|
||||||
for (i = 0; i < tmp->size / sizeof(char *); i++) {
|
for (i = 0; i < pl->size / sizeof(char *); i++) {
|
||||||
if (tmp->list[i] != NULL) {
|
if (pl->list[i] != NULL) {
|
||||||
xfree(tmp->list[i]);
|
xfree(pl->list[i]);
|
||||||
tmp->list[i] = NULL;
|
pl->list[i] = NULL;
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree(tmp->list);
|
xfree(pl->list);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp->prog_track != NULL) {
|
if (pl->prog_track != NULL) {
|
||||||
xfree(tmp->prog_track);
|
xfree(pl->prog_track);
|
||||||
tmp->prog_track = NULL;
|
pl->prog_track = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree(*pl);
|
xfree(*pl_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
Loading…
Reference in New Issue
Block a user