Details
Details
- Reviewers
kib olce - Group Reviewers
Contributor Reviews (src) - Commits
- rGe8da57256d79: libutil: Make free_iovec() zero its arguments, like the manpage claims
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Man page also claims that iov is set to NULL, but you did not do that.
Was there a reason for the change except the man page compliance?
Comment Actions
Was there a reason for the change except the man page compliance?
Yes, the idea is to be able to reuse iov and iovlen right away after freeing previous ones:
build_iovec(&iov, &iovlen, ...); build_iovec(&iov, &iovlen, ...); ... free_iovec(&iov, &iovlen, ...); build_iovec(&iov, &iovlen, ...); build_iovec(&iov, &iovlen, ...); ...
Without this change one has to additionally put
iov = NULL; iovlen = 0;
after free_iovec.