Fix double free issue 61/233961/1
authormk5004.lee <mk5004.lee@samsung.com>
Thu, 21 May 2020 00:09:48 +0000 (09:09 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Thu, 21 May 2020 00:09:48 +0000 (09:09 +0900)
Change-Id: I8ed686f0bd871cadf6a7d09206796c21f9c31743
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
notification/src/notification_shared_file.c

index 5e2677d..75388c6 100644 (file)
@@ -767,6 +767,8 @@ EXPORT_API void notification_calibrate_private_sharing(
                if (strcmp(updated_noti->sound_path,
                                updated_noti->priv_sound_path) == 0) {
                        free(updated_noti->sound_path);
+                       updated_noti->sound_path = NULL;
+
                        if (source_noti->sound_path) {
                                updated_noti->sound_path = strdup(source_noti->sound_path);
                                if (updated_noti->sound_path == NULL)
@@ -779,6 +781,8 @@ EXPORT_API void notification_calibrate_private_sharing(
                if (strcmp(updated_noti->vibration_path,
                                updated_noti->priv_vibration_path) == 0) {
                        free(updated_noti->vibration_path);
+                       updated_noti->vibration_path = NULL;
+
                        if (source_noti->priv_vibration_path) {
                                updated_noti->vibration_path =
                                        strdup(source_noti->priv_vibration_path);