gpg: Fix possible read of unallocated memory