decode_select: do not allocate unused memory

* desc.c (decode_select): On entering syscall, do not allocate memory
in non-verbose mode.
This commit is contained in:
Дмитрий Левин 2015-01-28 01:26:04 +00:00
parent 73e98805dd
commit 2fc5d80858

4
desc.c
View File

@ -338,7 +338,7 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
if (entering(tcp)) {
tprintf("%d", (int) args[0]);
if (fdsize > 0) {
if (verbose(tcp) && fdsize > 0) {
fds = malloc(fdsize);
if (!fds)
die_out_of_memory();
@ -349,7 +349,7 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
tprints(", NULL");
continue;
}
if (!verbose(tcp) || !fds) {
if (!fds) {
tprintf(", %#lx", arg);
continue;
}