Skip to content
Snippets Groups Projects
Commit ff5a8f94 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9509: use vector for credential info

parent 8ef04480
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,7 @@ SIPAccount::SIPAccount(const std::string& accountID)
, serviceRoute_()
, tlsListenerPort_(DEFAULT_SIP_TLS_PORT)
, transportType_(PJSIP_TRANSPORT_UNSPECIFIED)
, cred_(NULL)
, cred_()
, tlsSetting_()
, contactHeader_()
, contactUpdateEnabled_(false)
......@@ -101,11 +101,6 @@ SIPAccount::SIPAccount(const std::string& accountID)
, link_(SIPVoIPLink::instance())
{}
SIPAccount::~SIPAccount()
{
delete [] cred_;
}
void SIPAccount::serialize(Conf::YamlEmitter *emitter)
{
using namespace Conf;
......@@ -927,11 +922,9 @@ void SIPAccount::setCredentials(const std::vector<std::map<std::string, std::str
}
// Create the credential array
delete[] cred_;
cred_ = new pjsip_cred_info[credentials_.size()];
cred_.resize(credentials_.size());
size_t i = 0;
for (vector<map<string, string > >::const_iterator iter = credentials_.begin();
iter != credentials_.end(); ++iter) {
map<string, string>::const_iterator val = (*iter).find(CONFIG_ACCOUNT_PASSWORD);
......
......@@ -110,11 +110,6 @@ class SIPAccount : public Account {
*/
SIPAccount(const std::string& accountID);
/**
* Virtual destructor
*/
virtual ~SIPAccount();
virtual VoIPLink* getVoIPLink();
std::string getUserAgentName() const;
......@@ -196,8 +191,8 @@ class SIPAccount : public Account {
void stopKeepAliveTimer();
pjsip_cred_info *getCredInfo() const {
return cred_;
const pjsip_cred_info* getCredInfo() const {
return &(*cred_.begin());
}
/**
......@@ -605,7 +600,7 @@ class SIPAccount : public Account {
/**
* Credential information stored for further registration.
*/
pjsip_cred_info *cred_;
std::vector<pjsip_cred_info> cred_;
/**
* The TLS settings, used only if tls is chosen as a sip transport.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment