aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-12-08 15:14:59 +0100
committerSverker Eriksson <[email protected]>2011-12-08 15:14:59 +0100
commit18589c852aa7a535bb518cf79a2c510caa830110 (patch)
tree8fb09eec1e47c006b8e896c2d0b2d38fdfed43d6 /erts/emulator/drivers/common
parent6578cd796f4b5c161ed641baded4a6de435325c8 (diff)
parentea93ca94a8a73d5e3f27f6a23cdb82870ab66da8 (diff)
downloadotp-18589c852aa7a535bb518cf79a2c510caa830110.tar.gz
otp-18589c852aa7a535bb518cf79a2c510caa830110.tar.bz2
otp-18589c852aa7a535bb518cf79a2c510caa830110.zip
Merge branch 'sverk/misc-valgrind-fixes'
* sverk/misc-valgrind-fixes: erts: Suppress valgrind warning about syscall sendmsg erts: Fix memory leak in test drivers erts: Small fix in inet_drv.c:sctp_set_opts
Diffstat (limited to 'erts/emulator/drivers/common')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 45089dcc2f..b452acba32 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -539,6 +539,13 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
(((unsigned char*) (s))[1] << 8) | \
(((unsigned char*) (s))[0]))
+
+#ifdef VALGRIND
+# include <valgrind/memcheck.h>
+#else
+# define VALGRIND_MAKE_MEM_DEFINED(ptr,size)
+#endif
+
/*----------------------------------------------------------------------------
** Interface constants.
**
@@ -6189,7 +6196,7 @@ static int sctp_set_opts(inet_descriptor* desc, char* ptr, int len)
proto = IPPROTO_SCTP;
type = SCTP_DELAYED_ACK_TIME;
arg_ptr = (char*) (&arg.av);
- arg_sz = sizeof ( arg.es);
+ arg_sz = sizeof ( arg.av);
break;
}
# endif
@@ -10245,6 +10252,7 @@ static void packet_inet_command(ErlDrvData e, char* buf, int len)
cmsg.hdr.cmsg_level = IPPROTO_SCTP;
cmsg.hdr.cmsg_type = SCTP_SNDRCV;
cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(*sri));
+ VALGRIND_MAKE_MEM_DEFINED(&cmsg, (char*)sri - (char*)&cmsg); /*suppress padding as "uninitialised bytes"*/
data_len = (buf + len) - ptr;
/* The whole msg.