diff --git a/lib/asn1/der_copy.c b/lib/asn1/der_copy.c index 232625204..7d0c62559 100644 --- a/lib/asn1/der_copy.c +++ b/lib/asn1/der_copy.c @@ -38,10 +38,9 @@ RCSID("$Id$"); int copy_general_string (const general_string *from, general_string *to) { - *to = malloc(strlen(*from) + 1); + *to = strdup(*from); if(*to == NULL) return ENOMEM; - strcpy(*to, *from); return 0; }