summaryrefslogtreecommitdiff
path: root/udfinfo/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'udfinfo/main.c')
-rw-r--r--udfinfo/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/udfinfo/main.c b/udfinfo/main.c
index da7dd1d..0c17679 100644
--- a/udfinfo/main.c
+++ b/udfinfo/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Pali Rohár <pali.rohar@gmail.com>
+ * Copyright (C) 2017-2018 Pali Rohár <pali.rohar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -179,8 +179,15 @@ int main(int argc, char *argv[])
appname = "udfinfo";
memset(&disc, 0, sizeof(disc));
- disc.flags = FLAG_LOCALE;
+
disc.head = calloc(1, sizeof(struct udf_extent));
+ if (!disc.head)
+ {
+ fprintf(stderr, "%s: Error: calloc failed: %s\n", appname, strerror(errno));
+ exit(1);
+ }
+
+ disc.flags = FLAG_LOCALE;
disc.tail = disc.head;
disc.head->space_type = USPACE;