handle error case in uuid_dump.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7006 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-12-28 21:14:44 +00:00
parent 5407426702
commit 04e33f191a
1 changed files with 5 additions and 1 deletions

View File

@ -2012,12 +2012,16 @@ SWITCH_STANDARD_API(uuid_dump_function)
switch_assert(channel != NULL); switch_assert(channel != NULL);
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
switch_xml_t xml;
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
if (format && !strcasecmp(format, "xml")) { if (format && !strcasecmp(format, "xml")) {
switch_xml_t xml;
if ((xml = switch_event_xmlize(event, "%s", ""))) { if ((xml = switch_event_xmlize(event, "%s", ""))) {
buf = switch_xml_toxml(xml, SWITCH_FALSE); buf = switch_xml_toxml(xml, SWITCH_FALSE);
switch_xml_free(xml); switch_xml_free(xml);
} else {
stream->write_function(stream, "-ERR Unable to create xml!\n");
switch_core_session_rwunlock(psession);
goto done;
} }
} else { } else {
switch_event_serialize(event, &buf, SWITCH_TRUE); switch_event_serialize(event, &buf, SWITCH_TRUE);