diff options
-rw-r--r-- | src/song.c | 15 | ||||
-rw-r--r-- | src/song.h | 2 | ||||
-rw-r--r-- | src/song_save.c | 2 |
3 files changed, 3 insertions, 16 deletions
diff --git a/src/song.c b/src/song.c index 9436df97c..75dd0257f 100644 --- a/src/song.c +++ b/src/song.c @@ -28,17 +28,6 @@ #include "os_compat.h" -Song *newNullSong(void) -{ - Song *song = xmalloc(sizeof(Song)); - - song->tag = NULL; - song->url = NULL; - song->type = SONG_TYPE_FILE; - song->parentDir = NULL; - - return song; -} Song *newSong(const char *url, enum song_type type, Directory * parentDir) { @@ -49,8 +38,8 @@ Song *newSong(const char *url, enum song_type type, Directory * parentDir) return NULL; } - song = newNullSong(); - + song = xmalloc(sizeof(*song)); + song->tag = NULL; song->url = xstrdup(url); song->type = type; song->parentDir = parentDir; diff --git a/src/song.h b/src/song.h index 0b55a0f3f..f7466e24c 100644 --- a/src/song.h +++ b/src/song.h @@ -42,8 +42,6 @@ typedef struct _Song { time_t mtime; } Song; -Song *newNullSong(void); - Song *newSong(const char *url, enum song_type type, struct _Directory *parentDir); diff --git a/src/song_save.c b/src/song_save.c index cc5e4e4dd..3cb17f97b 100644 --- a/src/song_save.c +++ b/src/song_save.c @@ -111,7 +111,7 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv, if (song) insertSongIntoList(sv, song); - song = newNullSong(); + song = xmalloc(sizeof(*song)); song->url = xstrdup(buffer + strlen(SONG_KEY)); song->type = SONG_TYPE_FILE; song->parentDir = parentDir; |