=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mktemp/mktemp.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/mktemp/mktemp.c 2003/04/07 19:25:43 1.9 +++ src/usr.bin/mktemp/mktemp.c 2003/04/25 20:02:02 1.10 @@ -1,4 +1,4 @@ -/* $OpenBSD: mktemp.c,v 1.9 2003/04/07 19:25:43 millert Exp $ */ +/* $OpenBSD: mktemp.c,v 1.10 2003/04/25 20:02:02 millert Exp $ */ /* * Copyright (c) 1996, 1997, 2001 Todd C. Miller @@ -28,7 +28,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: mktemp.c,v 1.9 2003/04/07 19:25:43 millert Exp $"; +static const char rcsid[] = "$OpenBSD: mktemp.c,v 1.10 2003/04/25 20:02:02 millert Exp $"; #endif /* not lint */ #include @@ -99,8 +99,8 @@ while (plen != 0 && prefix[plen - 1] == '/') plen--; - tempfile = NULL; - asprintf(&tempfile, "%.*s/%s", plen, prefix, template); + if (asprintf(&tempfile, "%.*s/%s", plen, prefix, template) < 0) + tempfile = NULL; } else tempfile = strdup(template); if (tempfile == NULL) {