mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
Add additional memory debugging to several core APIs, and fix several memory
leaks found with these changes. (Closes issue #13505, closes issue #13543) Reported by: mav3rick, triccyx Patches: 20081001__bug13505.diff.txt uploaded by Corydon76 (license 14) Tested by: mav3rick, triccyx git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -189,12 +189,22 @@ unsigned int ast_hashtab_hash_short(const short num);
|
||||
* \param hash a func ptr to do the hashing
|
||||
* \param do_locking use locks to guarantee safety of iterators/insertion/deletion -- real simpleminded right now
|
||||
*/
|
||||
#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
|
||||
struct ast_hashtab * _ast_hashtab_create(int initial_buckets,
|
||||
int (*compare)(const void *a, const void *b),
|
||||
int (*resize)(struct ast_hashtab *),
|
||||
int (*newsize)(struct ast_hashtab *tab),
|
||||
unsigned int (*hash)(const void *obj),
|
||||
int do_locking, const char *file, int lineno, const char *function);
|
||||
#define ast_hashtab_create(a,b,c,d,e,f) _ast_hashtab_create(a,b,c,d,e,f,__FILE__,__LINE__,__PRETTY_FUNCTION__)
|
||||
#else
|
||||
struct ast_hashtab * ast_hashtab_create(int initial_buckets,
|
||||
int (*compare)(const void *a, const void *b),
|
||||
int (*resize)(struct ast_hashtab *),
|
||||
int (*newsize)(struct ast_hashtab *tab),
|
||||
unsigned int (*hash)(const void *obj),
|
||||
int do_locking );
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief This func will free the hash table and all its memory.
|
||||
|
||||
Reference in New Issue
Block a user