[Freeswitch-users] Memory leak in mod_nibblebill or in ODBC core?

Sergey Okhapkin sos at sokhapkin.dyndns.org
Mon Apr 19 12:17:09 PDT 2010


It would be the problem if custom_sql_* is set in nibblebill configuration, 
but it's not my case, I do not use custom sql. I'm looking at the code 
more....

On Monday 19 April 2010, Brian West wrote:
> No this isn't the problem it would show up on valgrind like crazy.
> 
> /b
> 
> On Apr 19, 2010, at 1:25 PM, Sergey Okhapkin wrote:
> > Yes, I agree that these strdups can be ignored. I believe I found where
> > the memory problem comes from, the beginning of bill_event function in
> > mod_nubblebill has SWITCH_STANDARD_STREAM(sql_stream);
> > But SWITCH_STANDARD_STREAM macro does malloc! I do not see a place in the
> > function where the memory is freed. Am I right? #define
> > SWITCH_STANDARD_STREAM(s) memset(&s, 0, sizeof(s)); s.data =
> > malloc(SWITCH_CMD_CHUNK_LEN); \ switch_assert(s.data);                   
> >                                                                       \
> > memset(s.data, 0, SWITCH_CMD_CHUNK_LEN);                                 
> >                       \ s.end = s.data;                                  
> >                                                                       \
> > s.data_size = SWITCH_CMD_CHUNK_LEN;                                      
> >                               \ s.write_function =
> > switch_console_stream_write;                                         \
> > s.raw_write_function = switch_console_stream_raw_write;                  
> >       \ s.alloc_len = SWITCH_CMD_CHUNK_LEN;                              
> >                                       \ s.alloc_chunk =
> > SWITCH_CMD_CHUNK_LEN
> 




More information about the FreeSWITCH-users mailing list