res_pjsip: Fix assertion for pjsip.conf authorization list options.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 4 Feb 2014 18:55:32 +0000 (18:55 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 4 Feb 2014 18:55:32 +0000 (18:55 +0000)
(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

res/res_pjsip/pjsip_configuration.c

index e560438..c21582e 100644 (file)
@@ -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);