summaryrefslogtreecommitdiff
path: root/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'bitmap.c')
-rw-r--r--bitmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bitmap.c b/bitmap.c
index 86176696..0f8a2653 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -125,7 +125,10 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief)
void *buf;
int n, skip;
- posix_memalign(&buf, 512, 8192);
+ if (posix_memalign(&buf, 512, 8192) != 0) {
+ fprintf(stderr, Name ": failed to allocate 8192 bytes\n");
+ return NULL;
+ }
n = read(fd, buf, 8192);
info = malloc(sizeof(*info));