couple of valgrind error squash patches

Stefan Metzmacher metze at samba.org
Tue Jan 10 16:59:51 UTC 2017


Hi Noel,

> Please have a look and push if they are ok

I think the tdgram_bsd_recvfrom_handler change is wrong.

tdgram_bsd_recvfrom_recv() only returns a buffer that's
filled by recvfrom() and the talloc_realloc() truncates
the buffer. So the memset writes behind the buffer,
it may not be noticed by valgrind if talloc isn't build
with valgrind support and the caller uses a talloc_pool.

However I think there's a small memory leak in
tdgram_bsd_recvfrom_handler().

        if (retry) {
                /* retry later */
                return;
        }

Before the return we should call
state->len = 0;
TALLOC_FREE(state->buf);

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170110/d7ffc449/signature.sig>


More information about the samba-technical mailing list