projects
/
platform
/
core
/
uifw
/
tts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e714e80
)
Fix defect that is detected by static analysis tool
55/281755/3
author
wn.jang
<wn.jang@samsung.com>
Wed, 21 Sep 2022 10:36:35 +0000
(19:36 +0900)
committer
wn.jang
<wn.jang@samsung.com>
Wed, 21 Sep 2022 10:41:24 +0000
(19:41 +0900)
Cause: When calloc returns NULL, dereferencing a pointer might be nullptr data.
Solution: Check whether calloc is succeeded or not.
Change-Id: I72aa53d041d9cd5d358907f6d2f7ebcb140ab601
tests/src/tts_unittests.cpp
patch
|
blob
|
history
diff --git
a/tests/src/tts_unittests.cpp
b/tests/src/tts_unittests.cpp
index f49e97e5c2053c4d73e2d8fb14e7b59da0f99108..fe20c80751cd58587c3b6fe0c561aae40f47f193 100644
(file)
--- a/
tests/src/tts_unittests.cpp
+++ b/
tests/src/tts_unittests.cpp
@@
-186,6
+186,10
@@
static void __get_test_PCM_Data()
}
char* data = (char*)calloc(sizeof(char), size);
+ if (NULL == data) {
+ fclose(fp_in);
+ return;
+ }
size_t read_size = fread(data, sizeof(char), size, fp_in);
fclose(fp_in);