From 897a1f2557a5750e62f6ee8aa46d081098832508 Mon Sep 17 00:00:00 2001 From: Yunmi Ha Date: Thu, 6 Feb 2020 14:52:35 +0900 Subject: [PATCH] sound: Add logic for checking NULL - For fix svace issue Change-Id: I1ed485fff3f01686c1120b30e3af85f0d463bced Signed-off-by: Yunmi Ha --- src/sound.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sound.c b/src/sound.c index 08905ab..8e54a8d 100644 --- a/src/sound.c +++ b/src/sound.c @@ -276,9 +276,13 @@ static int sound_set_path(feedback_pattern_e pattern, char *path) continue; sound_info.data[i].pattern = pattern; - sound_info.data[i].changed = strdup(path); + if (path) + sound_info.data[i].changed = strdup(path); + else + sound_info.data[i].changed = NULL; + _D("The file of pattern(%s) is changed to [%s]", - profile->str_pattern(pattern), path); + profile->str_pattern(pattern), path? path:"NULL"); return 0; } -- 2.7.4