Check result of calloc [CID-181]

This commit is contained in:
Love Hornquist Astrand
2009-07-30 09:44:44 +02:00
parent 3f802d359f
commit 90ed2b6790

View File

@@ -142,6 +142,10 @@ main(int argc, char **argv)
} }
arg = calloc(2, sizeof(arg[0])); arg = calloc(2, sizeof(arg[0]));
if (arg == NULL) {
perror("calloc");
exit(1);
}
arg[0] = option_file; arg[0] = option_file;
arg[1] = NULL; arg[1] = NULL;
len = 1; len = 1;