resources after initial BN_bin2bn() calls for `p' and `g'; just utilize the original code and call BN_free() after initializing `a' if anything had failed.