From a601c01a3bae887b25b6cc8c6dc91ed694f497eb Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Dec 09 2011 18:39:31 +0000 Subject: Fix potential resource leak in backup_file.c --- diff --git a/src/util/backup_file.c b/src/util/backup_file.c index fb1604b..ba77640 100644 --- a/src/util/backup_file.c +++ b/src/util/backup_file.c @@ -68,7 +68,7 @@ int backup_file(const char *src_file, int dbglvl) dst_fd = open(dst_file, O_CREAT|O_EXCL|O_WRONLY, 0600); ret = errno; - if (dst_fd > 0) break; + if (dst_fd >= 0) break; if (ret != EEXIST) { DEBUG(dbglvl, ("Error (%d [%s]) opening destination file %s\n",