Add xmlSaveFormatFile() check routine
[platform/core/api/system-settings.git] / src / sst_font.c
index 446ca99..e14f709 100644 (file)
@@ -144,9 +144,12 @@ int sst_font_set_type(sst_interface *iface, const char *font_name)
 
        xmlDocPtr doc = font_conf_doc_parse(SETTING_FONT_CONF_FILE, font_name);
        if (doc != NULL) {
-               xmlSaveFormatFile(SETTING_FONT_CONF_FILE, doc, 0);
+               int ret = xmlSaveFormatFile(SETTING_FONT_CONF_FILE, doc, 0);
                xmlFreeDoc(doc);
-               doc = NULL;
+               if (ret <= -1) {
+                       ERR("xmlSaveFormatFile() Fail");
+                       return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+               }
        }
 
        sstu_font_config_set_notification();