mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
res_pjsip: Fix startup/reload memory leak in config_auth.
An issue in config_auth.c:ast_sip_auth_digest_algorithms_vector_init() was causing double allocations for the two supported_algorithms vectors to the tune of 915 bytes. The leak only happens on startup and when a reload is done and doesn't get bigger with the number of auth objects defined. * Pre-initialized the two vectors in config_auth:auth_alloc(). * Removed the allocations in ast_sip_auth_digest_algorithms_vector_init(). * Added a note to the doc for ast_sip_auth_digest_algorithms_vector_init() noting that the vector passed in should be initialized and empty. * Simplified the create_artificial_auth() function in pjsip_distributor. * Set the vector initialization count to 0 in config_global:global_apply().
This commit is contained in:
@@ -1333,7 +1333,7 @@ enum ast_sip_check_auth_result {
|
||||
* \brief Populate a vector of algorithm types from a string.
|
||||
*
|
||||
* \param id The object id to use in error messages
|
||||
* \param algorithms The vector to populate
|
||||
* \param algorithms The initialized but empty vector to populate
|
||||
* \param agent_type The type of agent to use in error messages ("UAC" or "UAS")
|
||||
* \param value The comma-separated string to parse for algorithms
|
||||
*
|
||||
|
Reference in New Issue
Block a user