commit 2513f20abd32eca0e2f74e92abd73629b4360258 from: Stefan Sperling date: Tue Oct 20 21:09:01 2020 UTC plug memory leaks in error paths; found by naddy commit - 74cfe85e3941b6738539031e8c2cf8e59db13eab commit + 2513f20abd32eca0e2f74e92abd73629b4360258 blob - a46191b6be513b0aa32c2a166157fe86ee15aefe blob + 330247efd1de37a205a200f8fa6f361ef6dd2d67 --- lib/worktree.c +++ lib/worktree.c @@ -2052,7 +2052,7 @@ remove_ondisk_file(const char *root_path, const char * char *parent; err = got_path_dirname(&parent, ondisk_path); if (err) - return err; + break; free(ondisk_path); ondisk_path = parent; if (rmdir(ondisk_path) == -1) { @@ -3919,7 +3919,7 @@ schedule_for_deletion(void *arg, unsigned char status, char *parent; err = got_path_dirname(&parent, ondisk_path); if (err) - return err; + goto done; free(ondisk_path); ondisk_path = parent; if (rmdir(ondisk_path) == -1) {