[Home]

Summary:ASTERISK-13184: [patch] Fix a memory leak while using threadstorage.
Reporter:Eliel Sardanons (eliel)Labels:
Date Opened:2008-12-09 08:42:37.000-0600Date Closed:2008-12-09 08:49:29.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/func_odbc
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) func_odbc.c.patch
Description:We are allocating a threadstorage when it is not needed, and the memory will never be deallocated until asterisk stops running (obviusly).
This is when calling the CLI command implementation with CLI_INIT.

Also we were not checking the allocation result.
Comments:By: Digium Subversion (svnbot) 2008-12-09 08:49:27.000-0600

Repository: asterisk
Revision: 161947

U   trunk/funcs/func_odbc.c

------------------------------------------------------------------------
r161947 | eliel | 2008-12-09 08:49:26 -0600 (Tue, 09 Dec 2008) | 8 lines

Avoid allocating memory for a thread that don't need it. Also, this memory was not being freed until the
main thread ends. (That is never).

(closes issue ASTERISK-13184)
Reported by: eliel
Patches:
     func_odbc.c.patch uploaded by eliel (license 64)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=161947