From e74a0e4f53d10b7742ccd690a798306237ffdb81 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 22 Jan 2016 20:31:12 +0000 Subject: [PATCH] Fix a null pointer dereference in create_espeak_pronunciation_list(espeak_command.c). [Coverity] --- src/libespeak-ng/espeak_command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libespeak-ng/espeak_command.c b/src/libespeak-ng/espeak_command.c index 3b0cb0cc..da010766 100644 --- a/src/libespeak-ng/espeak_command.c +++ b/src/libespeak-ng/espeak_command.c @@ -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;