diff options
author | Corey Farrell <git@cfware.com> | 2017-11-06 18:55:00 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-11-06 18:55:00 -0500 |
commit | 7ef38d399a80f90b804cdbdc12224ee0f02e6a9c (patch) | |
tree | 93bc309c17f715fa73bdaa36646f24a5bf624144 /res/res_pjsip_outbound_registration.c | |
parent | 637b37fb980822f50966f5292a786d03a859cd89 (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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index 7fa6e2c10..d9afcd284 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -1385,10 +1385,10 @@ static int sip_outbound_registration_perform(void *data) 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) { - 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) { - 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; |