Return an error in ASN1_TYPE_unpack_sequence if argument is NULL
[openssl.git] / crypto / evp / pmeth_lib.c
index 9f81d10021a065d820025896575924c90f0a4297..b20a902ef7ba759f65b540fe3fe2a3844fc3895d 100644 (file)
@@ -65,8 +65,8 @@
 #ifndef OPENSSL_NO_ENGINE
 # include <openssl/engine.h>
 #endif
-#include "asn1_locl.h"
-#include "evp_locl.h"
+#include "internal/asn1_int.h"
+#include "internal/evp_int.h"
 
 typedef int sk_cmp_fn_type(const char *const *a, const char *const *b);
 
@@ -363,10 +363,8 @@ void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)
         return;
     if (ctx->pmeth && ctx->pmeth->cleanup)
         ctx->pmeth->cleanup(ctx);
-    if (ctx->pkey)
-        EVP_PKEY_free(ctx->pkey);
-    if (ctx->peerkey)
-        EVP_PKEY_free(ctx->peerkey);
+    EVP_PKEY_free(ctx->pkey);
+    EVP_PKEY_free(ctx->peerkey);
 #ifndef OPENSSL_NO_ENGINE
     if (ctx->engine)
         /*