mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
Avoid NULL dereference after returning from copy().
okay martijn@
This commit is contained in:
parent
8f6effc924
commit
cb8ad17457
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: fortune.c,v 1.60 2017/08/10 17:00:08 millert Exp $ */
|
||||
/* $OpenBSD: fortune.c,v 1.61 2020/12/15 14:06:32 zhuk Exp $ */
|
||||
/* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
@ -718,7 +718,7 @@ copy(char *str, char *suf)
|
||||
char *new;
|
||||
|
||||
if (asprintf(&new, "%s%s", str, suf ? suf : "") == -1)
|
||||
return NULL;
|
||||
err(1, NULL);
|
||||
return new;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user