From c7ead85cb9daabe26df467b16ddefbbc7b1d3f3c Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 24 Jul 2018 14:17:40 +0200 Subject: idevicebackup2: Fix fd leak in mb2_copy_file_by_path() fd was leak in error path. --- tools/idevicebackup2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/idevicebackup2.c') diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index e6c1d3f..010e51d 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -1150,6 +1150,7 @@ static void mb2_copy_file_by_path(const char *src, const char *dst) /* open destination file */ if ((to = fopen(dst, "wb")) == NULL) { printf("Cannot open destination file '%s'.\n", dst); + fclose(from); return; } -- cgit v1.1-32-gdbae