From cdeaac0ad0c31a25d20e8d0e270a294c6822abf7 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 24 Jul 2015 16:56:41 -0700 Subject: [PATCH] twisted: deallocate in more errorful situations --- src/wormhole/twisted/transcribe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wormhole/twisted/transcribe.py b/src/wormhole/twisted/transcribe.py index 487e991..712bd3a 100644 --- a/src/wormhole/twisted/transcribe.py +++ b/src/wormhole/twisted/transcribe.py @@ -249,6 +249,7 @@ class SymmetricWormhole: if self.code is None: raise UsageError d = self._get_key() d.addCallback(self._get_data2, outbound_data) + d.addBoth(self._deallocate) return d def _get_data2(self, key, outbound_data): @@ -268,7 +269,6 @@ class SymmetricWormhole: except CryptoError: raise WrongPasswordError d.addCallback(_got_data) - d.addBoth(self._deallocate) return d def _deallocate(self, res):