add talloc0 function (malloc and zero fill) check return values of arithmetic openssl BN_* functions check return values of BN_bin2bn function remove useless BN_init calls right after BN_new fix 2 small memory leaks