mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-05 14:47:26 +00:00
Fix a null pointer dereference in create_espeak_pronunciation_list(espeak_command.c). [Coverity]
This commit is contained in:
@@ -179,6 +179,10 @@ t_espeak_command *create_espeak_punctuation_list(const wchar_t *punctlist)
|
||||
|
||||
size_t len = (wcslen(punctlist) + 1)*sizeof(wchar_t);
|
||||
wchar_t *a_list = (wchar_t *)malloc(len);
|
||||
if (a_list == NULL) {
|
||||
free(a_command);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(a_list, punctlist, len);
|
||||
a_command->u.my_punctuation_list = a_list;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user