Author: kotkov
Date: Mon Nov 21 15:04:18 2022
New Revision: 1905436

Reduce the lifetime of the svn_txdelta_apply2() source stream within the
delta editor that is used for file externals.

* subversion/libsvn_wc/externals.c
  (apply_textdelta): Do not disown the stream, so that it would be closed
   together with the target stream.  The source stream is a local variable
   scoped to the apply_textdelta() function; it's not used anywhere outside/
   after the delta application.


Modified: subversion/trunk/subversion/libsvn_wc/externals.c
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Mon Nov 21 15:04:18 2022
@@ -645,9 +645,7 @@ apply_textdelta(void *file_baton,
                                               eb->db, eb->wri_abspath,
                                               eb->pool, pool));
-  /* Keep historical behavior by disowning the stream; adjust if needed. */
-  svn_txdelta_apply2(svn_stream_disown(src_stream, pool),
-                     dest_stream, NULL, eb->local_abspath, pool,
+  svn_txdelta_apply2(src_stream, dest_stream, NULL, eb->local_abspath, pool,
                      handler, handler_baton);
   return SVN_NO_ERROR;

Reply via email to