Check for out of memory.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1009 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -135,6 +135,10 @@ set (int argc, char **argv, int count, OtpAlgorithm *alg)
|
||||
|
||||
ctx.alg = alg;
|
||||
ctx.user = strdup (pwd->pw_name);
|
||||
if (ctx.user == NULL) {
|
||||
fprintf (stderr, "%s: Out of memory\n", prog);
|
||||
return 1;
|
||||
}
|
||||
ctx.n = atoi (argv[0]);
|
||||
strncpy (ctx.seed, argv[1], sizeof(ctx.seed));
|
||||
ctx.seed[sizeof(ctx.seed) - 1] = '\0';
|
||||
|
Reference in New Issue
Block a user