Use thread save settings alloc_str function where appropriate

This commit is contained in:
Martin Willi
2011-04-21 10:48:16 +02:00
parent 17ce69b47a
commit 3e2419ebe3
15 changed files with 90 additions and 48 deletions
@@ -257,6 +257,7 @@ METHOD(radius_socket_t, destroy, void,
DESTROY_IF(this->hasher);
DESTROY_IF(this->signer);
DESTROY_IF(this->rng);
chunk_clear(&this->secret);
close(this->fd);
free(this);
}
@@ -300,7 +301,7 @@ radius_socket_t *radius_socket_create(host_t *host, chunk_t secret)
destroy(this);
return NULL;
}
this->secret = secret;
this->secret = chunk_clone(secret);
this->signer->set_key(this->signer, secret);
/* we use a random identifier, helps if we restart often */
this->identifier = random();