lib: fix some segfaults and a memory leak
There are some ptr which may be NULL and dereferenced without checking NULL. Here we add checking. There is a memory leak in crypt_pbkdf_check. Use "goto out" to instead of "return.
There are some ptr which may be NULL and dereferenced without checking NULL. Here we add checking. There is a memory leak in crypt_pbkdf_check. Use "goto out" to instead of "return.