diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs
index 5b4200b4db27d8328d0c7989a6c4b32541df6f0e..c9b188330c0a79c173a5b41c09545d3f2ff741ee 100644
--- a/ghc/compiler/utils/Util.lhs
+++ b/ghc/compiler/utils/Util.lhs
@@ -768,7 +768,8 @@ f $! x  = x `seq` f x
 bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
 bracket before after thing = do
   a <- before 
-  (thing a) `catch` (\err -> after a >>= fail err)
+  r <- (thing a) `catch` (\err -> after a >> fail err)
   after a
+  return r
 #endif
 \end{code}