aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-07 09:27:50 +0100
committerMax Kellermann <max@duempel.org>2014-01-07 09:27:50 +0100
commitda9dd58f34469ff9285233d694d43c2e078461ad (patch)
tree77d68875c678f568bcde5828a977552bd01893cc /src
parentbd01d80ffc5fec898117814f5bb5478639020ccf (diff)
downloadmpd-da9dd58f34469ff9285233d694d43c2e078461ad.tar.gz
mpd-da9dd58f34469ff9285233d694d43c2e078461ad.tar.xz
mpd-da9dd58f34469ff9285233d694d43c2e078461ad.zip
playlist/soundcloud: eliminate nullptr checks before g_free()
Diffstat (limited to 'src')
-rw-r--r--src/playlist/SoundCloudPlaylistPlugin.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/playlist/SoundCloudPlaylistPlugin.cxx b/src/playlist/SoundCloudPlaylistPlugin.cxx
index 3059b819e..68262fccb 100644
--- a/src/playlist/SoundCloudPlaylistPlugin.cxx
+++ b/src/playlist/SoundCloudPlaylistPlugin.cxx
@@ -146,13 +146,11 @@ handle_string(void *ctx, const unsigned char* stringval,
switch (data->key) {
case Title:
- if (data->title != nullptr)
- g_free(data->title);
+ g_free(data->title);
data->title = g_strndup(s, stringlen);
break;
case Stream_URL:
- if (data->stream_url != nullptr)
- g_free(data->stream_url);
+ g_free(data->stream_url);
data->stream_url = g_strndup(s, stringlen);
data->got_url = 1;
break;
@@ -399,10 +397,8 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
g_free(u);
yajl_free(hand);
- if (data.title != nullptr)
- g_free(data.title);
- if (data.stream_url != nullptr)
- g_free(data.stream_url);
+ g_free(data.title);
+ g_free(data.stream_url);
if (ret == -1)
return nullptr;