[Home]

Summary:ASTERISK-17527: [patch] There is a resource leak in func_odbc when inserting the previous handle not released
Reporter:Gregory Hinton Nietsky (irroot)Labels:
Date Opened:2011-03-09 07:20:57.000-0600Date Closed:2011-03-12 14:08:21.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Functions/func_odbc
Versions:1.8.3 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20110310__issue18943__162.diff.txt
( 1) 20110310__issue18943__18.diff.txt
( 2) func_odbc.insert.leak.patch
( 3) func_odbc.insert.leak.patch2
Description:There is a resource leak and eventual crash when insert is called.

patch fixes this and is self explanitory

patch is against trunk but should be good for > 1.6
Comments:By: Tilghman Lesher (tilghman) 2011-03-10 01:04:57.000-0600

While your patch fixes the leak, it's actually indicative of a larger problem: transactional handles should be used even for the failover insert statement.  So what really needs to happen is to port the code from above, so that the statement can occur as part of a transaction, if necessary.

By: Gregory Hinton Nietsky (irroot) 2011-03-10 10:26:57.000-0600

No prob indeed new patch loaded based on your proposals.

By: Gregory Hinton Nietsky (irroot) 2011-03-11 09:09:53.000-0600

if (obj && (stmt = ast_odbc_direct_execute(obj, generic_execute, ast_str_buffer(buf)))) {

SHOULD BE

if (obj && (stmt = ast_odbc_direct_execute(obj, generic_execute, ast_str_buffer(insertbuf)))) {

By: Digium Subversion (svnbot) 2011-03-12 13:51:24.000-0600

Repository: asterisk
Revision: 310414

U   branches/1.6.2/funcs/func_odbc.c

------------------------------------------------------------------------
r310414 | tilghman | 2011-03-12 13:51:24 -0600 (Sat, 12 Mar 2011) | 7 lines

Transactional handles should be used for the insertbuf, if available.

Also, fix a possible resource leak.

(closes issue ASTERISK-17527)
Reported by: irroot

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

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

By: Digium Subversion (svnbot) 2011-03-12 14:05:47.000-0600

Repository: asterisk
Revision: 310415

_U  branches/1.8/
U   branches/1.8/funcs/func_odbc.c

------------------------------------------------------------------------
r310415 | tilghman | 2011-03-12 14:05:47 -0600 (Sat, 12 Mar 2011) | 14 lines

Merged revisions 310414 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
 r310414 | tilghman | 2011-03-12 13:51:23 -0600 (Sat, 12 Mar 2011) | 7 lines
 
 Transactional handles should be used for the insertbuf, if available.
 
 Also, fix a possible resource leak.
 
 (closes issue ASTERISK-17527)
  Reported by: irroot
........

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

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

By: Digium Subversion (svnbot) 2011-03-12 14:08:20.000-0600

Repository: asterisk
Revision: 310416

_U  trunk/
U   trunk/funcs/func_odbc.c

------------------------------------------------------------------------
r310416 | tilghman | 2011-03-12 14:08:20 -0600 (Sat, 12 Mar 2011) | 21 lines

Merged revisions 310415 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
 r310415 | tilghman | 2011-03-12 14:05:46 -0600 (Sat, 12 Mar 2011) | 14 lines
 
 Merged revisions 310414 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.6.2
 
 ........
   r310414 | tilghman | 2011-03-12 13:51:23 -0600 (Sat, 12 Mar 2011) | 7 lines
   
   Transactional handles should be used for the insertbuf, if available.
   
   Also, fix a possible resource leak.
   
   (closes issue ASTERISK-17527)
    Reported by: irroot
 ........
................

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

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