libcacard: don't free sign buffer while sign op is pending
libcacard: don't free sign buffer while sign op is pending

commit 57f97834efe0c208ffadc9d2959f3d3d55580e52 cleaned up
the cac_applet_pki_process_apdu function to have a single
exit point. Unfortunately, that commit introduced a bug
where the sign buffer can get free'd and nullified while
it's still being used.

This commit corrects the bug by introducing a boolean to
track whether or not the sign buffer should be freed in
the function exit path.

Signed-off-by: Ray Strode <6caf3e77c6c00db1e35514851c9d38cba84b0ba7@redhat.com>
Reviewed-by: Alon Levy <381dc42aa497421c656ac95e6bb474c5318e600b@pobox.com>
Signed-off-by: Gerd Hoffmann <cad73e70082427fddc9be3baaf34e698dffd21c0@redhat.com>

elmarco/libcacard,SPICE/libcacard,SPICE/libcacard,elmarco/libcacard