]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 247841 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 18 Feb 2010 23:15:11 +0000 (23:15 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 18 Feb 2010 23:15:11 +0000 (23:15 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r247841 | tilghman | 2010-02-18 17:13:46 -0600 (Thu, 18 Feb 2010) | 7 lines

  Revert an errant part of a previous cleanup, to fix a memory corruption issue.

  (closes issue #16368)
   Reported by: thirionjwf
   Patches:
         res_speech.c.patch uploaded by thirionjwf (license 955)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@247843 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_speech.c

index 902955da19cb10be37e723d4f80f66ee3fe38e97..10a1e898941c92eafa27ea93acd8f9a6414b5f15 100644 (file)
@@ -313,8 +313,9 @@ int ast_speech_unregister(char *engine_name)
                        /* We have our engine... removed it */
                        AST_RWLIST_REMOVE_CURRENT(list);
                        /* If this was the default engine, we need to pick a new one */
-                       if (!default_engine)
+                       if (engine == default_engine) {
                                default_engine = AST_RWLIST_FIRST(&engines);
+                       }
                        ast_verb(2, "Unregistered speech recognition engine '%s'\n", engine_name);
                        /* All went well */
                        res = 0;