Fix compilation without LTO

When building without link-time-optimization through the
KITTY_NO_LTO env var or the setup.py --disable-link-time-optimization option
compilation failed with a warning about freeing "ans" memory.

Chances are, this is dead code that gets optimized out by LTO.
This commit is contained in:
Bernhard M. Wiedemann
2023-10-08 04:52:24 +02:00
parent edb9c924fe
commit 17b7703dab

View File

@@ -110,9 +110,9 @@ init_rsync(Rsync *ans, size_t block_size, int strong_hash_type, int checksum_typ
ans->hasher = ans->hasher_constructor();
ans->checksummer = ans->checksummer_constructor();
ans->hasher.state = ans->hasher.new();
if (ans->hasher.state == NULL) { free(ans); return "Out of memory"; }
if (ans->hasher.state == NULL) { free_rsync(ans); return "Out of memory"; }
ans->checksummer.state = ans->checksummer.new();
if (ans->checksummer.state == NULL) { free(ans); return "Out of memory"; }
if (ans->checksummer.state == NULL) { free_rsync(ans); return "Out of memory"; }
return NULL;
}