aboutsummaryrefslogtreecommitdiffstats
path: root/main/astobj2.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-11 00:29:59 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-11 00:29:59 +0000
commita914fe05112d518c6abfbc042ae593386ff3d219 (patch)
treed9ce0c66f8edace25beb5e6d7b7032155aa9d5fc /main/astobj2.c
parent78ae84644006651127e72a2b8a8e79a2b85a61db (diff)
Add MALLOC_DEBUG to various utility APIs, so that memory leaks can be tracked back to their source.
(related to issue #14636) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181028 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 8e33f94ae..7dd4c7ec1 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -138,7 +138,7 @@ static int __ao2_ref(void *user_data, const int delta);
static void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn);
static struct ao2_container *__ao2_container_alloc(struct ao2_container *c, const uint n_buckets, ao2_hash_fn *hash_fn,
ao2_callback_fn *cmp_fn);
-static struct bucket_list *__ao2_link(struct ao2_container *c, void *user_data);
+static struct bucket_list *__ao2_link(struct ao2_container *c, void *user_data, const char *file, int line, const char *func);
static void *__ao2_callback(struct ao2_container *c,
const enum search_flags flags, void *cb_fn, void *arg, void *data, enum ao2_callback_type type,
char *tag, char *file, int line, const char *funcname);
@@ -486,13 +486,13 @@ struct bucket_list {
* link an object to a container
*/
-static struct bucket_list *__ao2_link(struct ao2_container *c, void *user_data)
+static struct bucket_list *__ao2_link(struct ao2_container *c, void *user_data, const char *file, int line, const char *func)
{
int i;
/* create a new list entry */
struct bucket_list *p;
struct astobj2 *obj = INTERNAL_OBJ(user_data);
-
+
if (!obj)
return NULL;
@@ -518,8 +518,8 @@ static struct bucket_list *__ao2_link(struct ao2_container *c, void *user_data)
void *_ao2_link_debug(struct ao2_container *c, void *user_data, char *tag, char *file, int line, const char *funcname)
{
- struct bucket_list *p = __ao2_link(c, user_data);
-
+ struct bucket_list *p = __ao2_link(c, user_data, file, line, funcname);
+
if (p) {
_ao2_ref_debug(user_data, +1, tag, file, line, funcname);
ao2_unlock(c);
@@ -529,8 +529,8 @@ void *_ao2_link_debug(struct ao2_container *c, void *user_data, char *tag, char
void *_ao2_link(struct ao2_container *c, void *user_data)
{
- struct bucket_list *p = __ao2_link(c, user_data);
-
+ struct bucket_list *p = __ao2_link(c, user_data, __FILE__, __LINE__, __PRETTY_FUNCTION__);
+
if (p) {
_ao2_ref(user_data, +1);
ao2_unlock(c);