summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-02-28 00:03:31 +0100
committerRicardo Wurmus <rekado@elephly.net>2020-02-28 00:03:31 +0100
commitf7f2f759a6902f6ce54a13cb1f28e6161c431e05 (patch)
tree2b9243d6c2a16cdeb245ea863a3f2f809c82fe61
parent3612ac6f181a0ede9c21331fc70cfebff4c1a7ec (diff)
soap: Close body port.
This fixes a regression introduced by commit 6835883940f67b9fe34b0a7d47c52cf8a9b27407. * debbugs/soap.scm (soap-invoke): Do not leak the body port.
-rw-r--r--debbugs/soap.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/debbugs/soap.scm b/debbugs/soap.scm
index b142f8f..4432289 100644
--- a/debbugs/soap.scm
+++ b/debbugs/soap.scm
@@ -154,7 +154,13 @@ the SXML response body."
#:streaming? #t
#:decode-body? #t)
((soap-request-callback request)
- (xml->sxml body-port #:trim-whitespace? #t)))))
+ (dynamic-wind
+ (const #f)
+ (lambda ()
+ (xml->sxml body-port #:trim-whitespace? #t))
+ (lambda ()
+ (unless (port-closed? body-port)
+ (close-port body-port))))))))
(define (soap-invoke* . args)
"Cache the return value of SOAP-INVOKE. Return the cached value if