]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 192357 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 5 May 2009 13:37:23 +0000 (13:37 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 5 May 2009 13:37:23 +0000 (13:37 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r192357 | kpfleming | 2009-05-05 15:18:21 +0200 (Tue, 05 May 2009) | 5 lines

  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/branches/1.6.1@192359 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/stringfields.h
main/astobj2.c
main/utils.c

index f3b44fd942c9171efc28e4bdb4ea08301d854bc6..03b573287ac13d47e03c2c04e12c79d08b5c626f 100644 (file)
@@ -243,7 +243,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 */
 #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
index 8ecc9c2589badbe8ab0db9224a7fee6e23cc1989..9d23bf0f03c52b59621f9c160b23eaa280952e07 100644 (file)
@@ -353,7 +353,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)
 {
-       return __ao2_alloc(data_size, destructor_fn, NULL, 0, NULL);
+       return __ao2_alloc(data_size, destructor_fn, __FILE__, __LINE__, __FUNCTION__);
 }
 
 
index b11e2251f337b632502121506ff7a0aab9a6f781..76223498e8451d1c34f33adef3ecfd676c0bfd60 100644 (file)
@@ -1575,7 +1575,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))
                        return NULL;
 #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;
 #endif
        }