Commit 93756ed6 authored by Olivier Crête's avatar Olivier Crête

g_free is NULL-safe

parent 88bf95fe
...@@ -2655,9 +2655,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, ...@@ -2655,9 +2655,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
} }
} }
g_free (validater_data.password);
if (validater_data.password)
g_free (validater_data.password);
if (valid == STUN_VALIDATION_NOT_STUN || if (valid == STUN_VALIDATION_NOT_STUN ||
valid == STUN_VALIDATION_INCOMPLETE_STUN || valid == STUN_VALIDATION_INCOMPLETE_STUN ||
......
...@@ -407,10 +407,8 @@ void priv_generate_candidate_credentials (NiceAgent *agent, ...@@ -407,10 +407,8 @@ void priv_generate_candidate_credentials (NiceAgent *agent,
guchar username[32]; guchar username[32];
guchar password[16]; guchar password[16];
if (candidate->username) g_free (candidate->username);
g_free (candidate->username); g_free (candidate->password);
if (candidate->password)
g_free (candidate->password);
nice_rng_generate_bytes (agent->rng, 32, (gchar *)username); nice_rng_generate_bytes (agent->rng, 32, (gchar *)username);
nice_rng_generate_bytes (agent->rng, 16, (gchar *)password); nice_rng_generate_bytes (agent->rng, 16, (gchar *)password);
...@@ -421,10 +419,8 @@ void priv_generate_candidate_credentials (NiceAgent *agent, ...@@ -421,10 +419,8 @@ void priv_generate_candidate_credentials (NiceAgent *agent,
} else if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) { } else if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
gchar username[16]; gchar username[16];
if (candidate->username) g_free (candidate->username);
g_free (candidate->username); g_free (candidate->password);
if (candidate->password)
g_free (candidate->password);
candidate->password = NULL; candidate->password = NULL;
nice_rng_generate_bytes_print (agent->rng, 16, (gchar *)username); nice_rng_generate_bytes_print (agent->rng, 16, (gchar *)username);
......
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