This should look more like

```python
    def _get_value(self, bn):
        val = self._backend.lib.BN_bn2hex(bn)
        if val == self._backend.ffi.NULL:
            self._backend._handle_error()
        return int(self._backend.ffi.string(val), 16)
```
but I'm not seeing anything that needs to be freed. Am I missing something?