From: Bodo Möller Date: Thu, 29 Aug 2002 11:35:42 +0000 (+0000) Subject: don't memset(data,0,...) if data is NULL X-Git-Tag: OpenSSL_0_9_7-beta4~176 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=535cedf13672593d417fde4a26183dbe52bbe874;p=oweals%2Fopenssl.git don't memset(data,0,...) if data is NULL Submitted by: anonymous PR: 254 --- diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 18b751a91a..a8db6ffbf5 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -366,8 +366,11 @@ err: memset(iv,0,sizeof(iv)); memset((char *)&ctx,0,sizeof(ctx)); memset(buf,0,PEM_BUFSIZE); - memset(data,0,(unsigned int)dsize); - OPENSSL_free(data); + if (data != NULL) + { + memset(data,0,(unsigned int)dsize); + OPENSSL_free(data); + } return(ret); }