[asterisk-commits] dlee: branch dlee/stasis-core r381846 - in /team/dlee/stasis-core: include/as...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 21 16:42:50 CST 2013


Author: dlee
Date: Thu Feb 21 16:42:46 2013
New Revision: 381846

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381846
Log:
Error checking; typos

Modified:
    team/dlee/stasis-core/include/asterisk/stasis.h
    team/dlee/stasis-core/main/channel.c

Modified: team/dlee/stasis-core/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-core/include/asterisk/stasis.h?view=diff&rev=381846&r1=381845&r2=381846
==============================================================================
--- team/dlee/stasis-core/include/asterisk/stasis.h (original)
+++ team/dlee/stasis-core/include/asterisk/stasis.h Thu Feb 21 16:42:46 2013
@@ -118,7 +118,7 @@
  * Any topic may be subscribed to by simply providing stasis_subscribe() the
  * \ref stasis_topic to subscribe to, a handler function and \c void pointer to
  * data that is passed back to the handler. Invocations on the subscription's
- * handler are serialized, but differen invocations may occur on different
+ * handler are serialized, but different invocations may occur on different
  * threads (this usually isn't important unless you use thread locals or
  * something similar).
  *
@@ -409,6 +409,7 @@
 /*!
  * \brief Retrieve an item from the cache.
  * \param caching_topic The topic returned from stasis_caching_topic_create().
+ * \param type Type of message to retrieve.
  * \param id Identity of the snapshot to retrieve.
  * \return Message from the cache. The cache still owns the message, so
  *         ao2_ref() if you want to keep it.

Modified: team/dlee/stasis-core/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-core/main/channel.c?view=diff&rev=381846&r1=381845&r2=381846
==============================================================================
--- team/dlee/stasis-core/main/channel.c (original)
+++ team/dlee/stasis-core/main/channel.c Thu Feb 21 16:42:46 2013
@@ -258,6 +258,11 @@
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 
 	event = ao2_alloc(sizeof(*event), ast_channel_varset_event_dtor);
+	if (!event) {
+		ast_log(LOG_ERROR, "Allocation failed\n");
+		return;
+	}
+
 	if (chan) {
 		event->channel_name = ast_strdup(ast_channel_name(chan));
 		event->uniqueid = ast_strdup(ast_channel_name(chan));
@@ -269,6 +274,10 @@
 	event->value = ast_strdup(value);
 
 	msg = stasis_message_create(ast_channel_varset_event(), event);
+	if (!msg) {
+		ast_log(LOG_ERROR, "Allocation failed\n");
+		return;
+	}
 
 	if (chan) {
 		stasis_publish(ast_channel_events(chan), msg);




More information about the asterisk-commits mailing list