Skip to content

Commit d30a36b

Browse files
authored
Merge pull request #157 from Sean-Der/master
Fix strdup on NULL song->real_uri
2 parents 7f787cb + 51f0824 commit d30a36b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/song.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ mpd_song_dup(const struct mpd_song *song)
219219
} while (src_tag != NULL);
220220
}
221221

222-
ret->real_uri = strdup(song->real_uri);
222+
if (song->real_uri != NULL) {
223+
ret->real_uri = strdup(song->real_uri);
224+
}
225+
223226
ret->duration = song->duration;
224227
ret->duration_ms = song->duration_ms;
225228
ret->start = song->start;

0 commit comments

Comments
 (0)