Fix NULL argument handling in mbedtls_xxx_free() functions

Signed-off-by: Troy-Butler <squintik@outlook.com>
diff --git a/library/pem.c b/library/pem.c
index 0fee5df..0207601 100644
--- a/library/pem.c
+++ b/library/pem.c
@@ -481,6 +481,10 @@
 
 void mbedtls_pem_free(mbedtls_pem_context *ctx)
 {
+    if (ctx == NULL) {
+        return;
+    }
+
     if (ctx->buf != NULL) {
         mbedtls_zeroize_and_free(ctx->buf, ctx->buflen);
     }