mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 14:17:12 +00:00
Fix the realloc usage of voices in espeak_ListVoices(voices.c) [msvc /analyze]
This commit is contained in:
@@ -1608,7 +1608,10 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
|
||||
|
||||
GetVoices(path_voices);
|
||||
voices_list[n_voices_list] = NULL; // voices list terminator
|
||||
voices = (espeak_VOICE **)realloc(voices, sizeof(espeak_VOICE *)*(n_voices_list+1));
|
||||
espeak_VOICE **new_voices = (espeak_VOICE **)realloc(voices, sizeof(espeak_VOICE *)*(n_voices_list+1));
|
||||
if (new_voices == NULL)
|
||||
return voices;
|
||||
voices = new_voices;
|
||||
|
||||
// sort the voices list
|
||||
qsort(voices_list, n_voices_list, sizeof(espeak_VOICE *),
|
||||
|
||||
Reference in New Issue
Block a user