When using the speech recognition module, crashes can occur
sporadically due to a "double free or corruption (out)" error. Now, in
the section where the audio stream is being captured in a loop, each
time after releasing fr, it is set to NULL to prevent repeated
deallocation.
Fixes #772
(cherry picked from commit
2d676c756002a82c3e6babf4594c2977a2a5836e)
time(¤t);
if ((current - start) >= timeout) {
reason = "timeout";
- if (fr)
+ if (fr) {
ast_frfree(fr);
+ fr = NULL;
+ }
break;
}
}
reason = "hangup";
}
ast_frfree(fr);
+ fr = NULL;
}
}