summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_registration.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-11-06 18:55:00 -0500
committerCorey Farrell <git@cfware.com>2017-11-06 18:56:33 -0500
commit69af7eb663be9ac3731241104405d37ac6d3f34d (patch)
treecad50e995ced538650b510e35b6de57e6d42ce40 /res/res_pjsip_outbound_registration.c
parentad7860fd194b69a86f43b41d6c20cdb2b653481d (diff)
res_pjsip_outbound_registration: Fix leak on vector add failure.
Change-Id: I774b88b3c9da41edd4dc8d78f095481f52f2bd46
Diffstat (limited to 'res/res_pjsip_outbound_registration.c')
-rw-r--r--res/res_pjsip_outbound_registration.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 731a1a939..0b177ae32 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -1386,10 +1386,10 @@ static int sip_outbound_registration_perform(void *data)
AST_VECTOR_INIT(&state->client_state->outbound_auths, AST_VECTOR_SIZE(&registration->outbound_auths));
for (i = 0; i < AST_VECTOR_SIZE(&registration->outbound_auths); ++i) {
- const char *name = ast_strdup(AST_VECTOR_GET(&registration->outbound_auths, i));
+ char *name = ast_strdup(AST_VECTOR_GET(&registration->outbound_auths, i));
- if (name) {
- AST_VECTOR_APPEND(&state->client_state->outbound_auths, name);
+ if (name && AST_VECTOR_APPEND(&state->client_state->outbound_auths, name)) {
+ ast_free(name);
}
}
state->client_state->retry_interval = registration->retry_interval;