mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Correct some flaws in the memory accounting code for stringfields and ao2 objects
Under some conditions, the memory allocation for stringfields and ao2 objects would not have supplied valid file/function names for MALLOC_DEBUG tracking, so this commit corrects that. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -244,7 +244,7 @@ void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
|
|||||||
|
|
||||||
/*! \brief free all memory - to be called before destroying the object */
|
/*! \brief free all memory - to be called before destroying the object */
|
||||||
#define ast_string_field_free_memory(x) \
|
#define ast_string_field_free_memory(x) \
|
||||||
__ast_string_field_init(&(x)->__field_mgr, &(x)->__field_mgr_pool, -1, NULL, 0, NULL)
|
__ast_string_field_init(&(x)->__field_mgr, &(x)->__field_mgr_pool, -1, __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \internal
|
* \internal
|
||||||
|
@@ -358,7 +358,7 @@ void *__ao2_alloc_debug(size_t data_size, ao2_destructor_fn destructor_fn, char
|
|||||||
|
|
||||||
void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn)
|
void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn)
|
||||||
{
|
{
|
||||||
return internal_ao2_alloc(data_size, destructor_fn, NULL, 0, NULL);
|
return internal_ao2_alloc(data_size, destructor_fn, __FILE__, __LINE__, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1605,7 +1605,7 @@ ast_string_field __ast_string_field_alloc_space(struct ast_string_field_mgr *mgr
|
|||||||
if (add_string_pool(mgr, pool_head, new_size, mgr->owner_file, mgr->owner_line, mgr->owner_func))
|
if (add_string_pool(mgr, pool_head, new_size, mgr->owner_file, mgr->owner_line, mgr->owner_func))
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
if (add_string_pool(mgr, pool_head, new_size, NULL, 0, NULL))
|
if (add_string_pool(mgr, pool_head, new_size, __FILE__, __LINE__, __FUNCTION__))
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user