From 145a2794dabd58fa5d01b87d5d0aef5b50f9bea1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Thu, 29 Aug 2002 11:33:43 +0000 Subject: [PATCH] don't memset(data,0,...) if data is NULL Submitted by: anonymous PR: 254 --- crypto/pem/pem_lib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 01759f75c3..043b578e22 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -405,8 +405,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); } -- 2.25.1