Properly account for memory allocated for channels and datastores

As in previous commits, when channels are allocated (with ast_channel_alloc) or datastores are allocated (with ast_datastore_alloc) properly account for the memory being owned by the caller, instead of the allocator function itself.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2009-05-05 10:34:19 +00:00
parent d8182202ef
commit ec5116f80c
6 changed files with 134 additions and 26 deletions

View File

@@ -65,7 +65,10 @@ struct ast_datastore {
* \param[in] uid unique identifer
* \version 1.6.1 moved here and renamed from ast_channel_datastore_alloc
*/
struct ast_datastore *ast_datastore_alloc(const struct ast_datastore_info *info, const char *uid);
struct ast_datastore * attribute_malloc __ast_datastore_alloc(const struct ast_datastore_info *info, const char *uid,
const char *file, int line, const char *function);
#define ast_datastore_alloc(info, uid) __ast_datastore_alloc(info, uid, __FILE__, __LINE__, __PRETTY_FUNCTION__)
/*!
* \brief Free a data store object