state callback xml error

This commit is contained in:
Olof hagsand 2019-11-14 22:16:45 +01:00
parent 039e08f86a
commit 43eb9fe9d2

View file

@ -134,9 +134,17 @@ clixon_plugin_statedata(clicon_handle h,
if (ret > 0 && (ret = xml_yang_validate_add(h, x, &xerr)) < 0) if (ret > 0 && (ret = xml_yang_validate_add(h, x, &xerr)) < 0)
goto done; goto done;
if (ret == 0){ if (ret == 0){
if ((cberr = cbuf_new()) ==NULL){
clicon_err(OE_XML, errno, "cbuf_new");
goto done;
}
cprintf(cberr, "Internal error: state callback returned invalid XML: "); cprintf(cberr, "Internal error: state callback returned invalid XML: ");
if (netconf_err2cb(xpath_first(xerr, "rpc-error"), cberr) < 0) if (netconf_err2cb(xpath_first(xerr, "rpc-error"), cberr) < 0)
goto done; goto done;
if (*xret){
xml_free(*xret);
*xret = NULL;
}
if (netconf_operation_failed_xml(xret, "application", cbuf_get(cberr))< 0) if (netconf_operation_failed_xml(xret, "application", cbuf_get(cberr))< 0)
goto done; goto done;
goto fail; goto fail;