mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
code analysis and fixes for teletone.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7614 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -191,10 +191,13 @@ static int ensure_buffer(teletone_generation_session_t *ts, int need)
|
||||
need *= ts->channels;
|
||||
|
||||
if (need > ts->datalen) {
|
||||
teletone_audio_t *tmp;
|
||||
ts->datalen = need + ts->dynamic;
|
||||
if (!(ts->buffer = realloc(ts->buffer, ts->datalen))) {
|
||||
tmp = realloc(ts->buffer, ts->datalen);
|
||||
if (!tmp) {
|
||||
return -1;
|
||||
}
|
||||
ts->buffer = tmp;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user