summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@cvs.openbsd.org>2014-07-08 16:36:46 +0000
committerBrent Cook <bcook@cvs.openbsd.org>2014-07-08 16:36:46 +0000
commit4bfa51796f21e8a7eace8882e6890334473a6618 (patch)
tree775aee6c060088806750dd5a64df9381009e9574
parentd1f50020abb9ee402b7e89ac06c9ed8bb2cb2c8f (diff)
replace malloc(strlen())/strlcpy with strdup
ok beck@ jsing@
-rw-r--r--lib/libcrypto/conf/conf_def.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c
index c4703d883b5..a5cfd86ae21 100644
--- a/lib/libcrypto/conf/conf_def.c
+++ b/lib/libcrypto/conf/conf_def.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf_def.c,v 1.24 2014/06/12 15:49:28 deraadt Exp $ */
+/* $OpenBSD: conf_def.c,v 1.25 2014/07/08 16:36:45 bcook Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -368,14 +368,13 @@ again:
}
if (psection == NULL)
psection = section;
- v->name = malloc(strlen(pname) + 1);
+ v->name = strdup(pname);
v->value = NULL;
if (v->name == NULL) {
CONFerr(CONF_F_DEF_LOAD_BIO,
ERR_R_MALLOC_FAILURE);
goto err;
}
- strlcpy(v->name, pname, strlen(pname) + 1);
if (!str_copy(conf, psection, &(v->value), start))
goto err;