aboutsummaryrefslogtreecommitdiff
path: root/mkswap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkswap.c')
-rw-r--r--mkswap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mkswap.c b/mkswap.c
index 130d24162..17866a735 100644
--- a/mkswap.c
+++ b/mkswap.c
@@ -116,7 +116,7 @@ static void init_signature_page()
116 if (pagesize != PAGE_SIZE) 116 if (pagesize != PAGE_SIZE)
117 fprintf(stderr, "Assuming pages of size %d\n", pagesize); 117 fprintf(stderr, "Assuming pages of size %d\n", pagesize);
118#endif 118#endif
119 signature_page = (int *) malloc(pagesize); 119 signature_page = (int *) xmalloc(pagesize);
120 memset(signature_page, 0, pagesize); 120 memset(signature_page, 0, pagesize);
121 p = (struct swap_header_v1 *) signature_page; 121 p = (struct swap_header_v1 *) signature_page;
122} 122}
@@ -230,9 +230,7 @@ void check_blocks(void)
230 int do_seek = 1; 230 int do_seek = 1;
231 char *buffer; 231 char *buffer;
232 232
233 buffer = malloc(pagesize); 233 buffer = xmalloc(pagesize);
234 if (!buffer)
235 die("Out of memory");
236 current_page = 0; 234 current_page = 0;
237 while (current_page < PAGES) { 235 while (current_page < PAGES) {
238 if (!check) { 236 if (!check) {