- struct ast_sip_auth **auths = ast_alloca(array->num * sizeof(*auths));
- pjsip_cred_info *auth_creds = ast_alloca(array->num * sizeof(*auth_creds));
+ size_t auth_size = AST_VECTOR_SIZE(auth_vector);
+ struct ast_sip_auth **auths = ast_alloca(auth_size * sizeof(*auths));
+ pjsip_cred_info *auth_creds = ast_alloca(auth_size * sizeof(*auth_creds));