See <http://bugs.debian.org/508046>.
gethostname(hostname, sizeof(hostname)-1);
#endif
hostname[sizeof(hostname)-1] = 0;
- asprintf(&ret, "%s.%u", hostname, (unsigned)getpid());
+ if (asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()) == -1) {
+ fatal("could not allocate tmp_string");
+ }
}
return ret;
if (len >= (int)sizeof(buf)-1) fatal("stats too long?!");
lseek(fd, 0, SEEK_SET);
- write(fd, buf, len);
+ if (write(fd, buf, len) == -1) fatal("could not write stats");
}
*ptr = NULL;
va_start(ap, format);
- vasprintf(ptr, format, ap);
+ if (vasprintf(ptr, format, ap) == -1) {
+ fatal("out of memory in x_asprintf");
+ }
va_end(ap);
if (!*ptr) fatal("out of memory in x_asprintf");