summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/cryptlib.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2014-07-22 02:21:20 +0000
committerbeck <beck@openbsd.org>2014-07-22 02:21:20 +0000
commit694428926dc83282ccb4d9e48dd9f22565103267 (patch)
treed6d7e4990a729c08f79b3319616873dcc91cacc4 /lib/libcrypto/cryptlib.c
parentHandle msgbuf_write() returning EAGAIN. (diff)
downloadwireguard-openbsd-694428926dc83282ccb4d9e48dd9f22565103267.tar.xz
wireguard-openbsd-694428926dc83282ccb4d9e48dd9f22565103267.zip
Kill a bunch more BUF_strdup's - these are converted to have a check for
NULL before an intrinsic strdup. ok miod@
Diffstat (limited to 'lib/libcrypto/cryptlib.c')
-rw-r--r--lib/libcrypto/cryptlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c
index 6a75d9568c0..000f76a6a23 100644
--- a/lib/libcrypto/cryptlib.c
+++ b/lib/libcrypto/cryptlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptlib.c,v 1.32 2014/07/11 08:44:47 jsing Exp $ */
+/* $OpenBSD: cryptlib.c,v 1.33 2014/07/22 02:21:20 beck Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -210,7 +210,7 @@ CRYPTO_get_new_lockid(char *name)
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
return (0);
}
- if ((str = BUF_strdup(name)) == NULL) {
+ if (name == NULL || (str = strdup(name)) == NULL) {
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
return (0);
}