Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
ssize_t to_send;
ssize_t thistime;
size_t sent;
- struct iovec *iov_copy, *iov;
+ struct iovec iov_copy[iovcnt];
+ struct iovec *iov;
to_send = iov_buflen(orig_iov, iovcnt);
if (to_send == -1) {
* discarding elements.
*/
- iov_copy = (struct iovec *)talloc_memdup(
- talloc_tos(), orig_iov, sizeof(struct iovec) * iovcnt);
-
- if (iov_copy == NULL) {
- errno = ENOMEM;
- return -1;
- }
+ memcpy(iov_copy, orig_iov, sizeof(struct iovec) * iovcnt);
iov = iov_copy;
while (sent < to_send) {
sent += thistime;
}
- TALLOC_FREE(iov_copy);
return sent;
}