Hi all,
Coverity is pointing out that we are doing pointer-NULL checks on
things that cannot be NULL in decrypt_internal():
out:
- if (src)
- mbuf_free(src);
- if (ctx)
- pgp_free(ctx);
+ Assert(ctx != NULL && src != NULL && dst != NULL);
+ mbuf_free(src);
+ pgp_free(ctx);
if (err)
{
px_set_debug_handler(NULL);
- if (dst)
- mbuf_free(dst);
+ mbuf_free(dst);
src, dst and ctx are created respectively from mbuf_create_from_data,
mbuf_create and pgp_init which never return NULL and they are palloc'd
all the time. I think that we could simplify things with the patch
attached, note that I added an assertion for correctness but I don't
really think that it is much necessary.
Regards,
--
Michael