summaryrefslogtreecommitdiffstats
path: root/src/socket_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket_wrapper.c')
-rw-r--r--src/socket_wrapper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 8a0e80d..98d9a99 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -5026,6 +5026,13 @@ static int swrap_sendmsg_filter_cmsghdr(const struct msghdr *_msg,
cm_data_space);
break;
}
+ if (rc < 0) {
+ int saved_errno = errno;
+ SAFE_FREE(*cm_data);
+ *cm_data_space = 0;
+ errno = saved_errno;
+ return rc;
+ }
}
return rc;