The fail3 error path skips the va_end() call, which typically leaks memory for
64bit x86 code.
Introduced by c/s
524a98c2ac5, spotted by Coverity.
Coverity-ID:
1399608
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
bounce[idx].h = xencall_alloc_buffer(xch->xcall, size);
if ( bounce[idx].h == NULL )
- goto fail3;
+ break; /* Error path handled after va_end(). */
memcpy(bounce[idx].h, u, size);
bounce[idx].u = u;
}
va_end(args);
+ if ( idx != nr_bufs )
+ goto fail3;
+
ret = xencall3(xch->xcall, __HYPERVISOR_dm_op,
domid, nr_bufs, HYPERCALL_BUFFER_AS_ARG(bufs));
if ( ret < 0 )