Consistently print OOM diagnostic messages
* bjm.c (sys_query_module): Use error_msg to print OOM diagnostics. * util.c (dumpiov, dumpstr): Likewise.
This commit is contained in:
parent
3e9d71feaa
commit
df3899149e
4
bjm.c
4
bjm.c
@ -107,7 +107,7 @@ SYS_FUNC(query_module)
|
||||
size_t idx;
|
||||
|
||||
if (!data) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
error_msg("Out of memory");
|
||||
tprintf(" /* %lu entries */ ", (unsigned long)ret);
|
||||
} else {
|
||||
if (umoven(tcp, tcp->u_arg[2],
|
||||
@ -134,7 +134,7 @@ SYS_FUNC(query_module)
|
||||
size_t idx;
|
||||
|
||||
if (!data) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
error_msg("Out of memory");
|
||||
tprintf(" /* %lu entries */ ", (unsigned long)ret);
|
||||
} else {
|
||||
if (umoven(tcp, tcp->u_arg[2],
|
||||
|
4
util.c
4
util.c
@ -828,7 +828,7 @@ dumpiov(struct tcb *tcp, int len, long addr)
|
||||
/* Assuming no sane program has millions of iovs */
|
||||
if ((unsigned)len > 1024*1024 /* insane or negative size? */
|
||||
|| (iov = malloc(size)) == NULL) {
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
error_msg("Out of memory");
|
||||
return;
|
||||
}
|
||||
if (umoven(tcp, addr, size, iov) >= 0) {
|
||||
@ -871,7 +871,7 @@ dumpstr(struct tcb *tcp, long addr, int len)
|
||||
str = malloc(len + 16);
|
||||
if (!str) {
|
||||
strsize = -1;
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
error_msg("Out of memory");
|
||||
return;
|
||||
}
|
||||
strsize = len + 16;
|
||||
|
Loading…
Reference in New Issue
Block a user