]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 261917 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 7 May 2010 21:25:13 +0000 (21:25 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 7 May 2010 21:25:13 +0000 (21:25 +0000)
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

funcs/func_odbc.c

index a72460041c03f13338c54bfa284fa23bbbda9f7f..5bb66c38b84d1e1a8a8d47b715de9307eb5a3594 100644 (file)
@@ -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) {