Commit da9dd58f authored by Max Kellermann's avatar Max Kellermann

playlist/soundcloud: eliminate nullptr checks before g_free()

parent bd01d80f
...@@ -146,12 +146,10 @@ handle_string(void *ctx, const unsigned char* stringval, ...@@ -146,12 +146,10 @@ handle_string(void *ctx, const unsigned char* stringval,
switch (data->key) { switch (data->key) {
case Title: case Title:
if (data->title != nullptr)
g_free(data->title); g_free(data->title);
data->title = g_strndup(s, stringlen); data->title = g_strndup(s, stringlen);
break; break;
case Stream_URL: 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->stream_url = g_strndup(s, stringlen);
data->got_url = 1; data->got_url = 1;
...@@ -399,9 +397,7 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond) ...@@ -399,9 +397,7 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
g_free(u); g_free(u);
yajl_free(hand); yajl_free(hand);
if (data.title != nullptr)
g_free(data.title); g_free(data.title);
if (data.stream_url != nullptr)
g_free(data.stream_url); g_free(data.stream_url);
if (ret == -1) if (ret == -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment