diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-02-04 18:55:32 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-02-04 18:55:32 +0000 |
commit | 844df94f9b3204d5b3ac6fbbd3d4245428f7dd68 (patch) | |
tree | c7b3d9d08354faeff013628e7785bed5fedd9609 | |
parent | 12668b6659279a9bead4a82f06a0f4a0785cc402 (diff) |
res_pjsip: Fix assertion for pjsip.conf authorization list options.
(closes issue ASTERISK-23168)
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3143/
........
Merged revisions 407324 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | res/res_pjsip/pjsip_configuration.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index e5604380e..c21582e1b 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -231,9 +231,13 @@ int ast_sip_auth_vector_init(struct ast_sip_auth_vector *auths, const char *valu char *val; ast_assert(auths != NULL); - ast_assert(AST_VECTOR_SIZE(auths) == 0); - AST_VECTOR_INIT(auths, 1); + if (AST_VECTOR_SIZE(auths)) { + ast_sip_auth_vector_destroy(auths); + } + if (AST_VECTOR_INIT(auths, 1)) { + return -1; + } while ((val = strsep(&auth_names, ","))) { val = ast_strdup(val); |