From: Tilghman Lesher Date: Fri, 7 May 2010 21:25:13 +0000 (+0000) Subject: Merged revisions 261917 via svnmerge from X-Git-Tag: 1.6.2.9-rc1~2^2~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=584d906cf9c1772338c4b00f47a2681609320829;p=thirdparty%2Fasterisk.git Merged revisions 261917 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r261917 | tilghman | 2010-05-07 15:54:35 -0500 (Fri, 07 May 2010) | 8 lines Double free crash (closes issue #17245) Reported by: thedavidfactor Patches: 20100426__issue17245.diff.txt uploaded by tilghman (license 14) Tested by: murraytm ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@261947 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index a72460041c..5bb66c38b8 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -321,6 +321,7 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co if (obj && !transactional) { ast_odbc_release_obj(obj); + obj = NULL; } } @@ -339,6 +340,10 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co SQLRowCount(stmt, &rows); break; } + if (obj) { + ast_odbc_release_obj(obj); + obj = NULL; + } } } else if (stmt) { status = "SUCCESS"; @@ -460,6 +465,10 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha if (stmt) { break; } + if (obj) { + ast_odbc_release_obj(obj); + obj = NULL; + } } if (!stmt) {