From 1ba13718fc46527587e3dc87e776858c472bb2d2 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Thu, 20 Mar 2014 16:35:57 +0000 Subject: assigned-uniqueids: Miscellaneous cleanup and fixes. * Fix memory leak in ast_unreal_new_channels(). Made it generate the ;2 uniqueid on a stack variable instead of mallocing it. * Made send error response to ARI and AMI requests instead of just logging excessive uniqueid length and allowing truncation. action_originate() and ari_channels_handle_originate_with_id(). * Fixed minor truncating uniqueid hole when generating the ;2 uniqueid string length. Created public and internal lengths of uniqueid. The internal length can handle a max public uniqueid plus an appended ;2. * free() and ast_free() are NULL tolerant so they don't need a NULL test before calling. * Made use better struct initialization format instead of the position dependent initialization format. Also anything not explicitly initialized in the struct is initialized to zero by the compiler. * Made ast_channel_internal_set_fake_ids() use the safer ast_copy_string() instead of strncpy(). Review: https://reviewboard.asterisk.org/r/3371/ ........ Merged revisions 410949 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410950 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_stasis_snoop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'res/res_stasis_snoop.c') diff --git a/res/res_stasis_snoop.c b/res/res_stasis_snoop.c index eaa21603a..169e02b75 100644 --- a/res/res_stasis_snoop.c +++ b/res/res_stasis_snoop.c @@ -290,7 +290,9 @@ struct ast_channel *stasis_app_control_snoop(struct ast_channel *chan, { RAII_VAR(struct stasis_app_snoop *, snoop, NULL, ao2_cleanup); pthread_t thread; - struct ast_assigned_ids assignedids = {snoop_id, NULL}; + struct ast_assigned_ids assignedids = { + .uniqueid = snoop_id, + }; if (spy == STASIS_SNOOP_DIRECTION_NONE && whisper == STASIS_SNOOP_DIRECTION_NONE) { -- cgit v1.2.3