Summary:ASTERISK-22126: Bridging: Memory leak for channels that hang up if they were in the bridging system
Reporter:Jonathan Rose (jrose)Labels:
Date Opened:2013-07-19 14:13:40Date Closed:2013-08-06 07:48:01
Versions:SVN 12 Frequency of
Description:What's leaking as reported by the memory allocation summary feature of MALLOC_DEBUG:
      728 bytes in          7 allocations by ast_channel_get_manager_vars() line  7506 of channel.c
      728 bytes in          7 allocations by ast_channel_get_vars() line  7480 of channel.

7506: ret = ao2_alloc(sizeof(*ret), varshead_dtor);
7480: ret = ao2_alloc(sizeof(*ret), varshead_dtor);

If a channel ever enters the bridging system, these two allocations will be leaked when the channel dies.

Easiest way to reproduce this is by calling bridgewait() on a channel.
Another easy method to reproduce this is to just have one device do a simple call to another.
Comments:By: Matt Jordan (mjordan) 2013-07-20 15:05:39.084-0500

I'd suspect that there's a ref leak on a channel snapshot someplace.

By: Kinsey Moore (kmoore) 2013-07-31 11:08:56.411-0500

That's what it sounds like, but from my limited testing with a single channel entering and exiting a bridge, the leak doesn't happen. Jonathan, can you still reproduce this leak (make sure to exit asterisk using "core stop gracefully")?