diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-01-11 23:44:04 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-01-11 23:44:04 +0100 |
| commit | 964d816726b8c765277b043894d534e9b1e0d60c (patch) | |
| tree | 0a7769532ebd41007a914889a0e96d171ad1ca55 /src/player_mpd.c | |
| parent | a9d37006eae7227d498c7c658360ee1e43b3e054 (diff) | |
| download | tmus-964d816726b8c765277b043894d534e9b1e0d60c.tar.gz tmus-964d816726b8c765277b043894d534e9b1e0d60c.zip | |
Check aprintf allocation internally and add astrdup for less OOM_CHECK
Diffstat (limited to 'src/player_mpd.c')
| -rw-r--r-- | src/player_mpd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/player_mpd.c b/src/player_mpd.c index 80f6750..528e75d 100644 --- a/src/player_mpd.c +++ b/src/player_mpd.c @@ -74,9 +74,9 @@ mpd_loaded_track_name(struct mpd_song *song) path = mpd_song_get_uri(song); sep = strrchr(path, '/'); - if (!sep) return strdup(path); + if (!sep) return astrdup(path); - return strdup(sep + 1); + return astrdup(sep + 1); } void @@ -169,7 +169,6 @@ player_update(void) if (current_song) { free(player.track_name); player.track_name = mpd_loaded_track_name(current_song); - OOM_CHECK(player.track_name); player.loaded = true; player.time_pos = mpd_status_get_elapsed_time(status); player.time_end = mpd_song_get_duration(current_song); |
