summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyuho Jo <kyuho.jo@samsung.com>2016-05-09 17:11:53 +0900
committerKyuho Jo <kyuho.jo@samsung.com>2016-05-09 19:21:36 +0900
commit3997e7ccd77e244fd3868f58ad815c1341ff6d0e (patch)
treedc59212ef66a3b814aeabebd88045b197e766c96
parent9e5f7db16509ace6ec5f3939486a9cbb1a69c135 (diff)
downloadair_infosquare-3997e7ccd77e244fd3868f58ad815c1341ff6d0e.tar.gz
air_infosquare-3997e7ccd77e244fd3868f58ad815c1341ff6d0e.tar.bz2
air_infosquare-3997e7ccd77e244fd3868f58ad815c1341ff6d0e.zip
Fixed a defect from svace.
Change-Id: I6fbb73219d537c592c3155153af0da7b1eb6dfe2 Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
-rwxr-xr-xsrc/util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 1762e57..de95691 100755
--- a/src/util.c
+++ b/src/util.c
@@ -117,7 +117,7 @@ Evas_Object *util_show_notification_popup(
char *start_tag = "<font=BreezeSans:style=Light color=#686868 align=left linesize=46 font_size=32>";
char *end_tag = "</font>";
- Evas_Object *notification_popup;
+ Evas_Object *notification_popup = NULL;
Evas_Object *window_layout = NULL;
Evas_Object *up_btn, *down_btn, *ok_btn;
Evas_Object *scroller, *scroller_label;
@@ -130,9 +130,19 @@ Evas_Object *util_show_notification_popup(
notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &title);
notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &temp_content);
+ if (temp_content == NULL) {
+ _ERR("temp_content is null");
+ goto out;
+ }
+
int buffer_size = strlen(start_tag)+strlen(temp_content)+strlen(end_tag);
content = (char *)calloc(buffer_size+1, sizeof(char));
+
+ if (content == NULL) {
+ _ERR("allocation for content failed");
+ goto out;
+ }
snprintf(content, buffer_size, "%s%s%s", start_tag, temp_content, end_tag);
/* Creating a Notification Window */