curlhttpsrc: do not check for NULL before g_free()

g_free() is NULL-safe.
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2017-07-26 16:51:50 -07:00
parent 85eb69d717
commit d82ae7a45f

View file

@ -380,39 +380,27 @@ gst_curl_http_src_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_URI: case PROP_URI:
if (source->uri != NULL) { g_free (source->uri);
g_free (source->uri);
}
source->uri = g_value_dup_string (value); source->uri = g_value_dup_string (value);
break; break;
case PROP_USERNAME: case PROP_USERNAME:
if (source->username != NULL) { g_free (source->username);
g_free (source->username);
}
source->username = g_value_dup_string (value); source->username = g_value_dup_string (value);
break; break;
case PROP_PASSWORD: case PROP_PASSWORD:
if (source->password != NULL) { g_free (source->password);
g_free (source->password);
}
source->password = g_value_dup_string (value); source->password = g_value_dup_string (value);
break; break;
case PROP_PROXYURI: case PROP_PROXYURI:
if (source->proxy_uri != NULL) { g_free (source->proxy_uri);
g_free (source->proxy_uri);
}
source->proxy_uri = g_value_dup_string (value); source->proxy_uri = g_value_dup_string (value);
break; break;
case PROP_PROXYUSERNAME: case PROP_PROXYUSERNAME:
if (source->proxy_user != NULL) { g_free (source->proxy_user);
g_free (source->proxy_user);
}
source->proxy_user = g_value_dup_string (value); source->proxy_user = g_value_dup_string (value);
break; break;
case PROP_PROXYPASSWORD: case PROP_PROXYPASSWORD:
if (source->proxy_pass != NULL) { g_free (source->proxy_pass);
g_free (source->proxy_pass);
}
source->proxy_pass = g_value_dup_string (value); source->proxy_pass = g_value_dup_string (value);
break; break;
case PROP_COOKIES: case PROP_COOKIES:
@ -421,9 +409,7 @@ gst_curl_http_src_set_property (GObject * object, guint prop_id,
source->number_cookies = g_strv_length (source->cookies); source->number_cookies = g_strv_length (source->cookies);
break; break;
case PROP_USERAGENT: case PROP_USERAGENT:
if (source->user_agent != NULL) { g_free (source->user_agent);
g_free (source->user_agent);
}
source->user_agent = g_value_dup_string (value); source->user_agent = g_value_dup_string (value);
break; break;
case PROP_HEADERS: case PROP_HEADERS: