From ed101eed833bdb53d6bcecdb4448040bd4ce9b5f Mon Sep 17 00:00:00 2001
From: TJ Saunders <tj@castaglia.org>
Date: Sat, 29 Jan 2022 11:20:14 -0800
Subject: [PATCH] Backport of fix for Bug#4467 to the 1.3.7 branch.

---
 NEWS               | 2 ++
 modules/mod_xfer.c | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/mod_xfer.c b/modules/mod_xfer.c
index 9348118c00..b7fcf74e94 100644
--- a/modules/mod_xfer.c
+++ b/modules/mod_xfer.c
@@ -2,7 +2,7 @@
  * ProFTPD - FTP server daemon
  * Copyright (c) 1997, 1998 Public Flood Software
  * Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver@tos.net>
- * Copyright (c) 2001-2020 The ProFTPD Project team
+ * Copyright (c) 2001-2022 The ProFTPD Project team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1014,9 +1014,8 @@ static void stor_abort(pool *p) {
         } 
       }
     }
-  }
 
-  if (session.xfer.path != NULL) {
+  } else if (session.xfer.path != NULL) {
     if (delete_stores != NULL &&
         *delete_stores == TRUE) {
       pr_log_debug(DEBUG5, "removing aborted file '%s'", session.xfer.path);
