[Pkg-voip-commits] [janus] 257/282: Fixed some typos (static analysis)

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.

commit 643f7d9967984b4329953eec7943a53825fb9990
Author: Lorenzo Miniero <lminiero at gmail.com>
Date:   Wed Dec 13 12:40:41 2017 +0100

    Fixed some typos (static analysis)
---
 plugins/janus_recordplay.c | 2 ++
 plugins/janus_sipre.c      | 4 ++--
 plugins/janus_textroom.c   | 2 +-
 sdp-utils.c                | 1 +
 transports/janus_pfunix.c  | 2 ++
 5 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/plugins/janus_recordplay.c b/plugins/janus_recordplay.c
index f79c607..ee2e61d 100644
--- a/plugins/janus_recordplay.c
+++ b/plugins/janus_recordplay.c
@@ -1217,6 +1217,8 @@ static void janus_recordplay_hangup_media_internal(janus_plugin_session *handle)
 	if(session->recorder) {
 		/* Create a .nfo file for this recording */
 		char nfofile[1024], nfo[1024];
+		nfofile[0] = '\0';
+		nfo[0] = '\0';
 		g_snprintf(nfofile, 1024, "%s/%"SCNu64".nfo", recordings_path, session->recording->id);
 		FILE *file = fopen(nfofile, "wt");
 		if(file == NULL) {
diff --git a/plugins/janus_sipre.c b/plugins/janus_sipre.c
index b2309b2..9c6c5d3 100644
--- a/plugins/janus_sipre.c
+++ b/plugins/janus_sipre.c
@@ -2871,8 +2871,8 @@ static int janus_sipre_allocate_local_ports(janus_sipre_session *session) {
 				/* RTP socket is not valid anymore, reset it */
 				close(session->media.video_rtp_fd);
 				session->media.video_rtp_fd = -1;
-				close(session->media.video_rtp_fd);
-				session->media.video_rtp_fd = -1;
+				close(session->media.video_rtcp_fd);
+				session->media.video_rtcp_fd = -1;
 				attempts--;
 				continue;
 			}
diff --git a/plugins/janus_textroom.c b/plugins/janus_textroom.c
index 25d4561..6f9c541 100644
--- a/plugins/janus_textroom.c
+++ b/plugins/janus_textroom.c
@@ -739,13 +739,13 @@ struct janus_plugin_result *janus_textroom_handle_message(janus_plugin_session *
 		json_object_set_new(root, "textroom", json_string(request_text));
 		json_object_set_new(root, "transaction", json_string(transaction));
 		janus_plugin_result *result = janus_textroom_handle_incoming_request(session->handle, NULL, root, FALSE);
-		janus_mutex_unlock(&sessions_mutex);
 		if(result == NULL) {
 			JANUS_LOG(LOG_ERR, "JSON error: not an object\n");
 			error_code = JANUS_TEXTROOM_ERROR_INVALID_JSON;
 			g_snprintf(error_cause, 512, "JSON error: not an object");
 			goto plugin_response;
 		}
+		janus_mutex_unlock(&sessions_mutex);
 		if(root != NULL)
 			json_decref(root);
 		if(jsep != NULL)
diff --git a/sdp-utils.c b/sdp-utils.c
index 66961f2..2572468 100644
--- a/sdp-utils.c
+++ b/sdp-utils.c
@@ -820,6 +820,7 @@ void janus_sdp_find_preferred_codecs(janus_sdp *sdp, const char **acodec, const
 				uint i=0;
 				for(i=0; i<janus_video_codecs; i++) {
 					if(janus_sdp_get_codec_pt(sdp, janus_preferred_video_codecs[i]) > 0) {
+						video = TRUE;
 						if(vcodec)
 							*vcodec = janus_preferred_video_codecs[i];
 						break;
diff --git a/transports/janus_pfunix.c b/transports/janus_pfunix.c
index 9da498f..a0bdf82 100644
--- a/transports/janus_pfunix.c
+++ b/transports/janus_pfunix.c
@@ -565,6 +565,8 @@ void *janus_pfunix_thread(void *data) {
 					while((payload = g_async_queue_try_pop(client->messages)) != NULL) {
 						int res = 0;
 						do {
+							if(client->fd < 0)
+								break;
 							res = write(client->fd, payload, strlen(payload));
 						} while(res == -1 && errno == EINTR);
 						/* FIXME Should we check if sent everything? */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list