mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-11 15:18:38 +00:00
res_pjsip_outbound_registration: Fix leak on vector add failure.
Change-Id: I774b88b3c9da41edd4dc8d78f095481f52f2bd46
This commit is contained in:
@@ -1386,10 +1386,10 @@ static int sip_outbound_registration_perform(void *data)
|
|||||||
|
|
||||||
AST_VECTOR_INIT(&state->client_state->outbound_auths, AST_VECTOR_SIZE(®istration->outbound_auths));
|
AST_VECTOR_INIT(&state->client_state->outbound_auths, AST_VECTOR_SIZE(®istration->outbound_auths));
|
||||||
for (i = 0; i < AST_VECTOR_SIZE(®istration->outbound_auths); ++i) {
|
for (i = 0; i < AST_VECTOR_SIZE(®istration->outbound_auths); ++i) {
|
||||||
const char *name = ast_strdup(AST_VECTOR_GET(®istration->outbound_auths, i));
|
char *name = ast_strdup(AST_VECTOR_GET(®istration->outbound_auths, i));
|
||||||
|
|
||||||
if (name) {
|
if (name && AST_VECTOR_APPEND(&state->client_state->outbound_auths, name)) {
|
||||||
AST_VECTOR_APPEND(&state->client_state->outbound_auths, name);
|
ast_free(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state->client_state->retry_interval = registration->retry_interval;
|
state->client_state->retry_interval = registration->retry_interval;
|
||||||
|
Reference in New Issue
Block a user