don't memset(data,0,...) if data is NULL
authorBodo Möller <bodo@openssl.org>
Thu, 29 Aug 2002 11:45:40 +0000 (11:45 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 29 Aug 2002 11:45:40 +0000 (11:45 +0000)
Submitted by: anonymous
PR: 254

crypto/pem/pem_lib.c

index c32044c..7066e67 100644 (file)
@@ -368,8 +368,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);
        }