Module: kamailio Branch: 5.1 Commit: b5f12075497cf2ab6bcfc71ab2550198065e7e87 URL: https://github.com/kamailio/kamailio/commit/b5f12075497cf2ab6bcfc71ab2550198...
Author: Henning Westerholt hw@kamailio.org Committer: Henning Westerholt hw@kamailio.org Date: 2018-12-30T18:42:41+01:00
cdp: fix two errors from coverty scan (missing check, var initialization)
- remove library call can fail, test for the error and log it - initialize the msghdr variable with a memset
(cherry picked from commit 7d52bf6ce7188eaa57690766c231e55b5509db4f)
---
Modified: src/modules/cdp/receiver.c
---
Diff: https://github.com/kamailio/kamailio/commit/b5f12075497cf2ab6bcfc71ab2550198... Patch: https://github.com/kamailio/kamailio/commit/b5f12075497cf2ab6bcfc71ab2550198...
---
diff --git a/src/modules/cdp/receiver.c b/src/modules/cdp/receiver.c index 46a16be650..2710387d29 100644 --- a/src/modules/cdp/receiver.c +++ b/src/modules/cdp/receiver.c @@ -157,10 +157,14 @@ static int make_send_pipe(serviced_peer_t *sp) */ static void close_send_pipe(serviced_peer_t *sp) { + int tmp; if (sp->send_pipe_name.s) { close(sp->send_pipe_fd); close(sp->send_pipe_fd_out); - remove(sp->send_pipe_name.s); + tmp = remove(sp->send_pipe_name.s); + if (tmp == -1) { + LM_ERR("could not remove send pipe\n"); + } shm_free(sp->send_pipe_name.s); sp->send_pipe_name.s=0; sp->send_pipe_name.len=0; @@ -269,6 +273,7 @@ static int send_fd(int pipe_fd,int fd, peer *p) struct iovec iov[1]; int ret; int *tmp = NULL; + memset(&msg, 0, sizeof(struct msghdr));
#ifdef HAVE_MSGHDR_MSG_CONTROL struct cmsghdr* cmsg;