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