[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 75/75] dump: Add close fd on error return to avoid resource leak
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 75/75] dump: Add close fd on error return to avoid resource leak |
Date: |
Tue, 7 Nov 2023 13:24:41 +0100 |
From: Zongmin Zhou <min_halo@163.com>
Reported-by: Coverity CID 1523842 (RESOURCE_LEAK)
Fixes: e6549197f7 ("dump: Add command interface for kdump-raw formats")
Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231107024417.585475-1-min_halo@163.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
dump/dump.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dump/dump.c b/dump/dump.c
index 1c304cadfd..ad5294e853 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -2160,6 +2160,7 @@ void qmp_dump_guest_memory(bool paging, const char
*protocol,
return;
}
if (kdump_raw && lseek(fd, 0, SEEK_CUR) == (off_t) -1) {
+ close(fd);
error_setg(errp, "kdump-raw formats require a seekable file");
return;
}
--
2.41.0
- [PULL 41/75] target/ppc: Move powerpc_input_t definition to 'cpu.h', (continued)
- [PULL 41/75] target/ppc: Move powerpc_input_t definition to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/07
- [PULL 40/75] target/ppc: Move powerpc_mmu_t definition to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/07
- [PULL 43/75] hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU*, Philippe Mathieu-Daudé, 2023/11/07
- [PULL 45/75] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/07
- [PULL 47/75] target: Move ArchCPUClass definition to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/07
- [PULL 44/75] target/s390x/cpu: Restrict cpu_get_tb_cpu_state() definition to TCG, Philippe Mathieu-Daudé, 2023/11/07
- [PULL 42/75] hw/s390x/css: Have css_do_sic() take S390CPU instead of CPUS390XState, Philippe Mathieu-Daudé, 2023/11/07
- [PULL 51/75] hw/cpu: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/11/07
- [PULL 68/75] hw/sd: Declare QOM types using DEFINE_TYPES() macro, Philippe Mathieu-Daudé, 2023/11/07
- [PULL 73/75] MAINTAINERS: Add more guest-agent related files to the corresponding section, Philippe Mathieu-Daudé, 2023/11/07
- [PULL 75/75] dump: Add close fd on error return to avoid resource leak,
Philippe Mathieu-Daudé <=
- [PULL 72/75] MAINTAINERS: Add include/hw/xtensa/mx_pic.h to the XTFPGA machine section, Philippe Mathieu-Daudé, 2023/11/07
- Re: [PULL 00/75] Misc HW/UI patches for 2023-11-07, Stefan Hajnoczi, 2023/11/08