diff options
author | teor <teor2345@gmail.com> | 2017-05-28 22:16:00 +1000 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2017-05-28 22:16:00 +1000 |
commit | 334fe6bb6b124c2f3eb1186610999446d57cde76 (patch) | |
tree | 516ea6581b8a7a84e1a17b2d972acefbc1b7d42a /src/common/storagedir.c | |
parent | 9e36b0beb9dc6fe02d43b4c217841c8164f41774 (diff) | |
download | tor-334fe6bb6b124c2f3eb1186610999446d57cde76.tar.gz tor-334fe6bb6b124c2f3eb1186610999446d57cde76.zip |
Don't underflow usage when it is unknown and a file is removed
Part of #22424.
Diffstat (limited to 'src/common/storagedir.c')
-rw-r--r-- | src/common/storagedir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/storagedir.c b/src/common/storagedir.c index 9140ed29bd..532fa2a2c8 100644 --- a/src/common/storagedir.c +++ b/src/common/storagedir.c @@ -425,7 +425,7 @@ storage_dir_remove_file(storage_dir_t *d, } } if (unlink(ipath) == 0) { - if (! BUG(d->usage < size)) { + if (d->usage_known && ! BUG(d->usage < size)) { d->usage -= size; } } else { |