notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &title);
notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &temp_content);
- content = (char *)calloc(strlen(start_tag)+strlen(temp_content)+strlen(end_tag), sizeof(char));
- snprintf(content, strlen(start_tag)+strlen(temp_content)+strlen(end_tag), "%s%s%s", start_tag, temp_content, end_tag);
+ int buffer_size = strlen(start_tag)+strlen(temp_content)+strlen(end_tag);
+
+ content = (char *)calloc(buffer_size+1, sizeof(char));
+ snprintf(content, buffer_size, "%s%s%s", start_tag, temp_content, end_tag);
/* Creating a Notification Window */
notification_popup = elm_win_add(NULL, "notification_popup", ELM_WIN_BASIC);
if (notification_popup == NULL) {
_ERR("elm_win_add failed");
- free(content);
goto out;
}
_ERR("evas_object_evas_get failed");
evas_object_del(notification_popup);
notification_popup = NULL;
- free(content);
goto out;
}
_ERR("ecore_evas_ecore_evas_get failed");
evas_object_del(notification_popup);
notification_popup = NULL;
- free(content);
goto out;
}
elm_win_activate(notification_popup);
out:
+ if(content != NULL)
+ free(content);
+
return notification_popup;
}