When the strdup() returns NULL, it should be handled properly.
Change-Id: I0f9639b47e804d7d8d2b11826a5227e22c1f95ff
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
converted_pattern = profile->get_strong_buzz(pattern);
temp = strdup(profile->str_pattern(converted_pattern));
+ if (!temp) {
+ _E("Failed to get vibration string pattern"); //LCOV_EXCL_LINE
+ return -ENOMEM; //LCOV_EXCL_LINE
+ }
+
data = trim_str(temp);
if (!data) {
free(temp); //LCOV_EXCL_LINE
/* get vibration data */
temp = strdup(profile->str_pattern(pattern));
+ if (!temp) {
+ _E("Failed to get vibration string pattern"); //LCOV_EXCL_LINE
+ return -ENOMEM; //LCOV_EXCL_LINE
+ }
+
data = trim_str(temp);
if (!data) {
free(temp); //LCOV_EXCL_LINE