1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Hmph. I've been stepping into the copy-of-pointer trap twice now. Fix it again.

git-svn-id: https://svn.xiph.org/trunk/ezstream@12681 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
moritz 2007-03-08 15:25:33 +00:00
parent 900886ab3f
commit 832c21def2
3 changed files with 14 additions and 10 deletions

View File

@ -297,12 +297,12 @@ processMetadata(shout_t *shout, const char *fileName)
}
if (!metadata_file_update(mdata)) {
metadata_free(mdata);
metadata_free(&mdata);
songInfo = xstrdup(blankString);
return (songInfo);
}
songInfo = xstrdup(metadata_get_string(mdata));
metadata_free(mdata);
metadata_free(&mdata);
if ((shout_mdata = shout_metadata_new()) == NULL) {
printf("%s: shout_metadata_new(): %s\n", __progname,

View File

@ -337,7 +337,7 @@ metadata_file(const char *filename)
md = metadata_create(filename);
if (!metadata_file_update(md)) {
metadata_free(md);
metadata_free(&md);
return (NULL);
}
@ -362,15 +362,19 @@ metadata_program(const char *program)
}
void
metadata_free(metadata_t *md)
metadata_free(metadata_t **md)
{
if (md == NULL)
metadata_t *tmp;
if (md == NULL || *md == NULL)
return;
if (md->filename != NULL)
xfree(md->filename);
metadata_clean_md(md);
xfree(md);
tmp = *md;
if (tmp->filename != NULL)
xfree(tmp->filename);
metadata_clean_md(tmp);
xfree(*md);
}

View File

@ -59,7 +59,7 @@ metadata_t * metadata_program(const char * /* program name */);
* Free all memory used by a metadata handle that has been created with
* metadata_file() or metadata_program().
*/
void metadata_free(metadata_t *);
void metadata_free(metadata_t **);
/*
* Update/read the metadata for the given handle. Returns 1 on success, and 0