From 96f9855f4f80cf831fb7c9a8379ab4490f17f378 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Mar 2024 14:32:10 +0000 Subject: [PATCH] apr_file_write, windows: Unlock the file in seek error path. Sumitted by: @296995966 on github. Github: closes #42 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1916276 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 66cdee604f..cbec2d50cf 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -470,6 +470,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } rc = apr_file_seek(thefile, APR_END, &offset); if (rc != APR_SUCCESS) { + apr_file_unlock(thefile); if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_unlock(thefile->mutex); }