NiceComponent *component;
gsize uname_len;
uint8_t *password = NULL;
+ uint8_t *free_password = NULL;
gsize password_len;
bool controlling = agent->controlling_mode;
/* XXX: add API to support different nomination modes: */
if (password != NULL &&
(agent->compatibility == NICE_COMPATIBILITY_MSN ||
agent->compatibility == NICE_COMPATIBILITY_OC2007)) {
- password = g_base64_decode ((gchar *) password, &password_len);
+ free_password = password =
+ g_base64_decode ((gchar *) password, &password_len);
}
if (nice_debug_is_enabled ()) {
if (uname_len == 0) {
nice_debug ("Agent %p: no credentials found, cancelling conncheck", agent);
+ g_free (free_password);
return -1;
}
nice_debug ("Agent %p: conncheck created %zd - %p", agent, buffer_len,
stun->message.buffer);
- if (agent->compatibility == NICE_COMPATIBILITY_MSN ||
- agent->compatibility == NICE_COMPATIBILITY_OC2007) {
- g_free (password);
- }
+ g_free (free_password);
if (buffer_len == 0) {
nice_debug ("Agent %p: buffer is empty, cancelling conncheck", agent);