Fixed some Coverity reported errors

These Coverity errors should be fixed (mostly classified as High
Impact Outstanding by Coverity):
53922, 53923, 53935, 53938, 53945, 53963, 53974, 53976, 53978, 53979,
53980, 53981, 53982, 53988, 53990, 53991, 53993, 53994, 53995, 53998,
54000, 54002, 54004, 54008, 54010, 54013, 54016, 54018, 54020, 54022,
54024, 54025, 54027, 54028, 54030, 54031, 54032, 54033, 54034, 54035,
54036, 54038, 54039, 54041, 54043, 54047, 54048, 54050, 54053, 54054,
54055, 54056, 54062, 54064, 54065, 54067, 54071, 54072, 54074, 54075,
54076, 54081, 54087, 54088, 54089, 54091, 54093, 54096, 54097, 54103,
54104, 54106, 54109, 54111, 54112, 54114, 54117, 54119, 54120, 54121,
54125, 54126, 54129, 54130, 54132, 54133, 54136, 54137, 54140, 54145,
54146, 54149, 54150, 54151, 54153, 54154, 54156, 54157
This commit is contained in:
Martin Pulec
2014-09-03 16:36:19 +02:00
parent d5b3dc8a9b
commit 06d89598fa
57 changed files with 498 additions and 349 deletions

View File

@@ -316,7 +316,9 @@ static int process_msg(struct control_state *s, fd_t client_fd, char *message)
resp =
send_message(s->root_module, path, (struct message *) msg);
send_message(s->root_module, path_audio, (struct message *) msg_audio);
struct response *resp_audio =
send_message(s->root_module, path_audio, (struct message *) msg_audio);
resp_audio->deleter(resp_audio);
} else if (prefix_matches(message, "receiver-port ")) {
struct msg_receiver *msg =
(struct msg_receiver *)
@@ -341,6 +343,7 @@ static int process_msg(struct control_state *s, fd_t client_fd, char *message)
strncpy(msg->fec, fec + 6, sizeof(msg->fec) - 1);
} else {
resp = new_response(RESPONSE_NOT_FOUND, strdup("unknown media type"));
free(msg);
}
if(!resp) {
@@ -654,9 +657,13 @@ void control_done(struct control_state *s)
module_done(&s->mod);
if(s->started) {
write_all(s->internal_fd[0], "quit\r\n", 6);
pthread_join(s->thread_id, NULL);
close(s->internal_fd[0]);
int ret = write_all(s->internal_fd[0], "quit\r\n", 6);
if (ret > 0) {
pthread_join(s->thread_id, NULL);
close(s->internal_fd[0]);
} else {
fprintf(stderr, "Cannot exit control thread!\n");
}
}
if(s->connection_type == SERVER) {
// for client, the socket has already been closed