Fix potential segfault condition in RC4_FREE
authorSimo Sorce <simo@redhat.com>
Thu, 17 Oct 2013 04:53:17 +0000 (00:53 -0400)
committerSimo Sorce <simo@redhat.com>
Fri, 18 Oct 2013 19:26:37 +0000 (15:26 -0400)
src/crypto.c

index dd33b342942fc50303af3e31278f80d952cfb9e9..aabd3994a7afd83ff8d9b4867f21e24a2467270d 100644 (file)
@@ -209,7 +209,7 @@ int RC4_UPDATE(struct ntlm_rc4_handle *handle,
 
 void RC4_FREE(struct ntlm_rc4_handle **handle)
 {
-    if (!handle) return;
+    if (!handle || !*handle) return;
     EVP_CIPHER_CTX_cleanup(&(*handle)->ctx);
     safefree(*handle);
 }