Re: [PATCH V2 1/2] plugins: Fix resource leak in connect_socket()

2020-11-09 Thread AlexChen
On 2020/11/6 21:17, Eric Blake wrote: > On 11/5/20 7:59 PM, AlexChen wrote: >> Close the fd when the connect() fails. >> >> Reported-by: Euler Robot >> Signed-off-by: Alex Chen > > Your From: line ("AlexChen") is spelled differently than your S-o-

Re: [PATCH] target/microblaze: Fix possible array out of bounds in mmu_write()

2020-11-08 Thread AlexChen
On 2020/11/6 22:16, Philippe Mathieu-Daudé wrote: > On 11/3/20 8:46 AM, AlexChen wrote: >> The size of env->mmu.regs is 3, but the range of 'rn' is [0, 5]. >> To avoid data access out of bounds, only if 'rn' is less than 3, we >> can print env->mm

[PATCH V2 2/2] plugins: Fix two resource leaks in setup_socket()

2020-11-05 Thread AlexChen
Either accept() fails or exits normally, we need to close the fd. Reported-by: Euler Robot Signed-off-by: Alex Chen --- contrib/plugins/lockstep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 319bd44b83..5aad50869d 100644 --

[PATCH V2 1/2] plugins: Fix resource leak in connect_socket()

2020-11-05 Thread AlexChen
Close the fd when the connect() fails. Reported-by: Euler Robot Signed-off-by: Alex Chen --- contrib/plugins/lockstep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index a696673dff..319bd44b83 100644 --- a/contrib/plugins/lockstep.

[PATCH V2 0/2] plugins: Fix some resource leaks

2020-11-05 Thread AlexChen
There are 3 resource leaks in contrib/plugins/lockstep.c, fix it. v1->v2: - add the cover letter - modify the subject of the patch[2/2] alexchen (2): plugins: Fix resource leak in connect_socket() plugins: Fix two resource leaks in setup_socket() contrib/plugins/lockstep.c | 3 +++ 1 f

Re: [PATCH 1/2] plugins: Fix resource leak in connect_socket()

2020-11-05 Thread AlexChen
On 2020/11/5 18:37, Alex Bennée wrote: > > AlexChen writes: > >> Kindly ping. > > Ahh sorry I missed these. Was there a cover letter for the series? > I forgot to send the cover letter, I will send the patch V2 with the cover letter. Thanks, Alex Chen

[PATCH] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test()

2020-11-05 Thread AlexChen
The 'addr' would not be NULL after checking 'succ' is valid, and it has been dereferenced in the previous code(args = g_strdup_printf()). So the check on 'addr' in the tpm_test_swtpm_test() is redundant. Remove it. Reported-by: Euler Robot Signed-off-by: Alex Chen --- tests/qtest/tpm-tests.c |

[PATCH] usb/hcd-xhci: Fix an index-out-of-bounds in xhci_runtime_write and xhci_runtime_read

2020-11-05 Thread AlexChen
Currently, the 'v' is not checked whether it is between 0 and 16, which may result in an out-of-bounds access to the array 'xhci->intr[]'. This is LP#1902112. Following is the reproducer provided in: -->https://bugs.launchpad.net/qemu/+bug/1902112 === Reproducer (build with --enable-sanitizers) ==

Re: [PATCH 2/2] plugins: Fix two resource leaks in connect_socket()

2020-11-04 Thread AlexChen
Kindly ping. On 2020/10/28 21:45, AlexChen wrote: > Either accept() fails or exits normally, we need to close the fd. > > Reported-by: Euler Robot > Signed-off-by: AlexChen > --- > contrib/plugins/lockstep.c | 2 ++ > 1 file changed, 2 insertions(+) > > d

Re: [PATCH 1/2] plugins: Fix resource leak in connect_socket()

2020-11-04 Thread AlexChen
Kindly ping. On 2020/10/28 21:45, AlexChen wrote: > Close the fd when connect() fails. > > Reported-by: Euler Robot > Signed-off-by: AlexChen > --- > contrib/plugins/lockstep.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/contrib/plugins/lockstep.c b

[PATCH V2] qtest: Fix bad printf format specifiers

2020-11-04 Thread AlexChen
We should use printf format specifier PRIu32 instead of "%d" for argument of type 'uint32_t'. Reported-by: Euler Robot Signed-off-by: Alex Chen --- tests/qtest/arm-cpu-features.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests/q

Re: [PATCH] qtest: Fix bad printf format specifiers

2020-11-04 Thread AlexChen
On 2020/11/4 18:44, Thomas Huth wrote: > On 04/11/2020 11.23, AlexChen wrote: >> We should use printf format specifier "%u" instead of "%d" for >> argument of type "unsigned int". >> >> Reported-by: Euler Robot >> Signed-o

[PATCH] contrib/libvhost-user: Fix bad printf format specifiers

2020-11-04 Thread AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". Reported-by: Euler Robot Signed-off-by: Alex Chen --- contrib/libvhost-user/libvhost-user.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/libv

[PATCH] qtest: Fix bad printf format specifiers

2020-11-04 Thread AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". Reported-by: Euler Robot Signed-off-by: Alex Chen --- tests/qtest/arm-cpu-features.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests

[PATCH] ssi: Fix bad printf format specifiers

2020-11-04 Thread AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". Reported-by: Euler Robot Signed-off-by: Alex Chen --- hw/ssi/imx_spi.c| 2 +- hw/ssi/xilinx_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/

[PATCH] tests/qtest: Fix potential NULL pointer dereference in qos_build_main_args()

2020-11-03 Thread AlexChen
In qos_build_main_args(), the pointer 'path' is dereferenced before checking it is valid, which may lead to NULL pointer dereference. So move the assignment to 'cmd_line' after checking 'path' is valid. Reported-by: Euler Robot Signed-off-by: Alex Chen --- tests/qtest/fuzz/qos_fuzz.c | 3 ++- 1

Re: [PATCH] hw/intc: Fix incorrect calculation of core in liointc_read() and liointc_write()

2020-11-03 Thread AlexChen
On 2020/11/3 17:53, Jiaxun Yang wrote: > > > 在 2020/11/3 17:32, AlexChen 写道: >> According to the loongson spec >> (http://www.loongson.cn/uploadfile/cpu/3B1500/Loongson_3B1500_cpu_user_1.pdf) >> and the macro definition(#define R_PERCORE_ISR(x) (0x40 + 0x8 * x)), we k

Re: block: Remove unused include

2020-11-03 Thread AlexChen
On 2020/11/3 21:26, Max Reitz wrote: > On 21.10.20 11:12, AlexChen wrote: >> The "qemu-common.h" include is not used, remove it. >> >> Reported-by: Euler Robot >> Signed-off-by: AlexChen >> --- >> block/dmg-lzfse.c | 1 - >> 1 file changed

[PATCH V2] block/vvfat: Fix bad printf format specifiers

2020-11-03 Thread AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". In addition, fix two error format problems found by checkpatch.pl: ERROR: space required after that ',' (ctx:VxV) +fprintf(stderr,"%s attributes=0x%02x begin=%u size=%d\n",

Re: [PATCH] block/vvfat: Fix bad printf format specifiers

2020-11-03 Thread AlexChen
On 2020/11/3 17:30, Kevin Wolf wrote: > Am 02.11.2020 um 12:52 hat AlexChen geschrieben: >> We should use printf format specifier "%u" instead of "%d" for >> argument of type "unsigned int". >> In addition, fix two error format problems found by

[PATCH] hw/intc: Fix incorrect calculation of core in liointc_read() and liointc_write()

2020-11-03 Thread AlexChen
According to the loongson spec (http://www.loongson.cn/uploadfile/cpu/3B1500/Loongson_3B1500_cpu_user_1.pdf) and the macro definition(#define R_PERCORE_ISR(x) (0x40 + 0x8 * x)), we know that the ISR size of per CORE is 8, so here we need to divide (addr - R_PERCORE_ISR(0)) by 8, not 4. Reported-by

[PATCH] target/microblaze: Fix possible array out of bounds in mmu_write()

2020-11-02 Thread AlexChen
The size of env->mmu.regs is 3, but the range of 'rn' is [0, 5]. To avoid data access out of bounds, only if 'rn' is less than 3, we can print env->mmu.regs[rn]. In other cases, we can print env->mmu.regs[MMU_R_TLBX]. Reported-by: Euler Robot Signed-off-by: Alex Chen --- target/microblaze/mmu.c

Re: [PATCH 0/4] qga: Fix some style problems

2020-11-02 Thread AlexChen
Kindly ping. On 2020/10/26 17:05, AlexChen wrote: > Fix some error style problems found by checkpatch.pl. > > alexchen (4): > qga: Add spaces around operator > qga: Delete redundant spaces > qga: Open brace '{' following struct go on the same > qga: switch

[PATCH] block/vvfat: Fix bad printf format specifiers

2020-11-02 Thread AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". In addition, fix two error format problems found by checkpatch.pl: ERROR: space required after that ',' (ctx:VxV) +fprintf(stderr,"%s attributes=0x%02x begin=%u size=%d\n",

[PATCH V2] util: Remove redundant checks in the openpty()

2020-11-02 Thread AlexChen
As we can see from the following function call stack, amaster and aslave can not be NULL: char_pty_open() -> qemu_openpty_raw() -> openpty(). In addition, according to the API specification for openpty(): https://www.gnu.org/software/libc/manual/html_node/Pseudo_002dTerminal-Pairs.html, the argumen

[PATCH V3] hw/display/exynos4210_fimd: Fix potential NULL pointer dereference

2020-11-02 Thread AlexChen
In exynos4210_fimd_update(), the pointer 's' is dereferenced before checking it is valid, which may lead to NULL pointer dereference. So move the assignment to global_width after checking 's' is valid. Reported-by: Euler Robot Signed-off-by: Alex Chen Reviewed-by: Philippe Mathieu-Daudé --- hw

Re: [PATCH V2] hw/display/exynos4210_fimd: Fix potential NULL pointer dereference

2020-11-02 Thread AlexChen
On 2020/11/2 17:16, Philippe Mathieu-Daudé wrote: > On 11/2/20 5:39 AM, AlexChen wrote: >> In exynos4210_fimd_update(), the pointer s is dereferinced before > > Typo dereferinced -> dereferenced. > >> being check if it is valid, which may lead to NULL pointer

[PATCH] hw/arm: Fix bad print format specifiers

2020-11-02 Thread AlexChen
We should use printf format specifier "%u" instead of "%i" for argument of type "unsigned int". Reported-by: Euler Robot Signed-off-by: Alex Chen --- hw/arm/pxa2xx.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/tosa.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/pxa

Re: [PATCH] util: Remove redundant checks in the openpty()

2020-11-01 Thread AlexChen
On 2020/10/31 23:21, Peter Maydell wrote: > On Sat, 31 Oct 2020 at 11:04, AlexChen wrote: >> >> As we can see from the following function call stack, the amaster and the >> aslave >> cannot be NULL: char_pty_open() -> qemu_openpty_raw() -> openpty(). >>

[PATCH V2] hw/display/exynos4210_fimd: Fix potential NULL pointer dereference

2020-11-01 Thread AlexChen
In exynos4210_fimd_update(), the pointer s is dereferinced before being check if it is valid, which may lead to NULL pointer dereference. So move the assignment to global_width after checking that the s is valid. Reported-by: Euler Robot Signed-off-by: Alex Chen --- hw/display/exynos4210_fimd.c

[PATCH] util: Remove redundant checks in the openpty()

2020-10-31 Thread AlexChen
As we can see from the following function call stack, the amaster and the aslave cannot be NULL: char_pty_open() -> qemu_openpty_raw() -> openpty(). In addition, the amaster and the aslave has been dereferenced at the beginning of the openpty(). So the checks on amaster and aslave in the openpty()

[PATCH V2] hw/display/omap_lcdc: Fix potential NULL pointer dereference

2020-10-30 Thread AlexChen
. Reported-by: Euler Robot Signed-off-by: AlexChen --- hw/display/omap_lcdc.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c index fa4a381db6..58e659c94f 100644 --- a/hw/display/omap_lcdc.c +++ b/hw/display/omap_lcdc.c

Re: [PATCH] hw/display/omap_lcdc: Fix potential NULL pointer dereference

2020-10-30 Thread AlexChen
On 2020/10/30 22:35, Peter Maydell wrote: > On Fri, 30 Oct 2020 at 14:29, Peter Maydell wrote: >> >> On Fri, 30 Oct 2020 at 10:23, AlexChen wrote: >>> >>> In omap_lcd_interrupts(), the pointer omap_lcd is dereferenced before >>> being check if i

Re: [PATCH] hw/display/exynos4210_fimd: Fix potential NULL pointer dereference

2020-10-30 Thread AlexChen
On 2020/10/30 22:28, Peter Maydell wrote: > On Fri, 30 Oct 2020 at 10:23, AlexChen wrote: >> >> In exynos4210_fimd_update(), the pointer s is dereferenced before >> being check if it is valid, which may lead to NULL pointer dereference. >> So move the assignment to

[PATCH] hw/display/omap_lcdc: Fix potential NULL pointer dereference

2020-10-30 Thread AlexChen
In omap_lcd_interrupts(), the pointer omap_lcd is dereferenced before being check if it is valid, which may lead to NULL pointer dereference. So move the assignment to surface after checking that the omap_lcd is valid. Reported-by: Euler Robot Signed-off-by: Alex Chen --- hw/display/omap_lcdc.c

[PATCH] hw/display/exynos4210_fimd: Fix potential NULL pointer dereference

2020-10-30 Thread AlexChen
In exynos4210_fimd_update(), the pointer s is dereferenced before being check if it is valid, which may lead to NULL pointer dereference. So move the assignment to global_width after checking that the s is valid Reported-by: Euler Robot Signed-off-by: Alex Chen --- hw/display/exynos4210_fimd.c

[PATCH] net/l2tpv3: Remove redundant check in net_init_l2tpv3()

2020-10-29 Thread AlexChen
The result has been checked to be NULL before, it cannot be NULL here, so the check is redundant. Remove it. Reported-by: Euler Robot Signed-off-by: AlexChen --- net/l2tpv3.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/l2tpv3.c b/net/l2tpv3.c index

[PATCH] contrib/rdmacm-mux: Fix error condition in hash_tbl_search_fd_by_ifid()

2020-10-29 Thread AlexChen
When fd is not found according to ifid, the _hash_tbl_search_fd_by_ifid() returns 0 and assigns the result to *fd, so We have to check that *fd is 0, not that fd is 0. Reported-by: Euler Robot Signed-off-by: AlexChen --- contrib/rdmacm-mux/main.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: block: Remove unused include

2020-10-29 Thread AlexChen
Kindly ping. Thanks, Alex On 2020/10/21 17:12, AlexChen wrote: > The "qemu-common.h" include is not used, remove it. > > Reported-by: Euler Robot > Signed-off-by: AlexChen > --- > block/dmg-lzfse.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/

Re: [PATCH 0/4] kvm: Add a --enable-debug-kvm option to configure

2020-10-28 Thread AlexChen
On 2020/10/28 15:44, Paolo Bonzini wrote: > On 28/10/20 08:11, AlexChen wrote: >> The current 'DEBUG_KVM' macro is defined in many files, and turning on >> the debug switch requires code modification, which is very inconvenient, >> so this series add an opt

[PATCH V2] vhost-user-blk/scsi: Fix broken error handling for socket call

2020-10-28 Thread AlexChen
When socket() fails, it returns -1, 0 is the normal return value and should not return error. Reported-by: Euler Robot Signed-off-by: AlexChen --- contrib/vhost-user-blk/vhost-user-blk.c | 2 +- contrib/vhost-user-scsi/vhost-user-scsi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions

Re: [PATCH] vhost-user-blk: Fix two resource leaks

2020-10-28 Thread AlexChen
for socket call"? > Thanks for your suggestion. I will modify the commit message in next version. Thanks, Alex > On Wed, Oct 28, 2020 at 10:10 AM AlexChen wrote: >> >> When socket() fails, it returns -1, 0 is the normal return value and should >> not return &g

[PATCH] vhost-user-blk: Fix two resource leaks

2020-10-28 Thread AlexChen
When socket() fails, it returns -1, 0 is the normal return value and should not return Reported-by: Euler Robot Signed-off-by: AlexChen --- contrib/vhost-user-blk/vhost-user-blk.c | 2 +- contrib/vhost-user-scsi/vhost-user-scsi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions

[PATCH 2/2] plugins: Fix two resource leaks in connect_socket()

2020-10-28 Thread AlexChen
Either accept() fails or exits normally, we need to close the fd. Reported-by: Euler Robot Signed-off-by: AlexChen --- contrib/plugins/lockstep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 319bd44b83..5aad50869d 100644

[PATCH 1/2] plugins: Fix resource leak in connect_socket()

2020-10-28 Thread AlexChen
Close the fd when connect() fails. Reported-by: Euler Robot Signed-off-by: AlexChen --- contrib/plugins/lockstep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index a696673dff..319bd44b83 100644 --- a/contrib/plugins/lockstep.c

[PATCH 4/4] i386/kvm: make printf always compile in debug output

2020-10-28 Thread AlexChen
Wrapped printf calls inside debug macros (DPRINTF) in `if` statement. This will ensure that printf function will always compile even if debug output is turned off and, in turn, will prevent bitrot of the format strings. Signed-off-by: AlexChen --- target/i386/kvm.c | 11 +-- 1 file

[PATCH 3/4] kvm: make printf always compile in debug output

2020-10-28 Thread AlexChen
Wrapped printf calls inside debug macros (DPRINTF) in `if` statement. This will ensure that printf function will always compile even if debug output is turned off and, in turn, will prevent bitrot of the format strings. Signed-off-by: AlexChen --- accel/kvm/kvm-all.c | 10 -- 1 file

[PATCH 0/4] kvm: Add a --enable-debug-kvm option to configure

2020-10-28 Thread AlexChen
rintf always compile in debug output which will prevent bitrot of the format strings by referring to the commit(08564ecd: s390x/kvm: make printf always compile in debug output). alexchen (4): configure: Add a --enable-debug-kvm option to configure kvm: replace DEBUG_KVM to CONFIG_DEBUG_KV

[PATCH 1/4] configure: Add a --enable-debug-kvm option to configure

2020-10-28 Thread AlexChen
This patch allows CONFIG_DEBUG_KVM to be defined when passing an option to the configure script. Signed-off-by: AlexChen --- configure | 10 ++ 1 file changed, 10 insertions(+) diff --git a/configure b/configure index e6754c1e87..2cdef5be4c 100755 --- a/configure +++ b/configure

[PATCH 2/4] kvm: Replace DEBUG_KVM with CONFIG_DEBUG_KVM

2020-10-28 Thread AlexChen
Now we can control the definition of DPRINTF by CONFIG_DEBUG_KVM, so let's replace DEBUG_KVM with CONFIG_DEBUG_KVM. Signed-off-by: AlexChen --- accel/kvm/kvm-all.c | 3 +-- target/i386/kvm.c | 4 +--- target/mips/kvm.c | 6 -- target/s390x/kvm.c | 6 +++--- 4 files chang

[PATCH 0/4] qga: Fix some style problems

2020-10-26 Thread AlexChen
Fix some error style problems found by checkpatch.pl. alexchen (4): qga: Add spaces around operator qga: Delete redundant spaces qga: Open brace '{' following struct go on the same qga: switch and case should be at the same indent qga/channel-win32.c | 6 ++--- qga/comman

[PATCH 3/4] qga: Open brace '{' following struct go on the same

2020-10-26 Thread AlexChen
Reported-by: Euler Robot Signed-off-by: AlexChen --- qga/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 308ebd6581..69660d9abd 100644 --- a/qga/main.c +++ b/qga/main.c @@ -694,8 +694,7 @@ DWORD WINAPI service_ctrl_handler(DWORD ctrl

[PATCH 4/4] qga: Switch and case should be at the same indent

2020-10-26 Thread AlexChen
Reported-by: Euler Robot Signed-off-by: AlexChen --- qga/main.c | 52 ++-- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/qga/main.c b/qga/main.c index 69660d9abd..33e510ba19 100644 --- a/qga/main.c +++ b/qga/main.c @@ -280,20

[PATCH 2/4] qga: Delete redundant spaces

2020-10-26 Thread AlexChen
Reported-by: Euler Robot Signed-off-by: AlexChen --- qga/commands-win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 2c341c7bea..de6e07f275 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1234,7

[PATCH 1/4] qga: Add spaces around operator

2020-10-26 Thread AlexChen
Reported-by: Euler Robot Signed-off-by: AlexChen --- qga/channel-win32.c | 6 +++--- qga/commands-posix.c | 4 ++-- qga/commands-win32.c | 24 qga/commands.c | 4 ++-- qga/main.c | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff

block: Remove unused include

2020-10-21 Thread AlexChen
The "qemu-common.h" include is not used, remove it. Reported-by: Euler Robot Signed-off-by: AlexChen --- block/dmg-lzfse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/dmg-lzfse.c b/block/dmg-lzfse.c index 19d25bc646..6798cf4fbf 100644 --- a/block/dmg-lzfse.c +++ b

io: Don't use '#' flag of printf format

2020-10-19 Thread AlexChen
Signed-off-by: AlexChen --- io/channel-websock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/channel-websock.c b/io/channel-websock.c index 47a0e941d9..e94a1fcf99 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -746,7 +746,7 @@ static int

Re: elf2dmp: Fix memory leak on main() error paths

2020-09-03 Thread AlexChen
Kindly ping. On 2020/8/26 18:15, AlexChen wrote: > From: AlexChen > > The 'kdgb' is allocating memory in get_kdbg(), but it is not freed > in both fill_header() and fill_context() failed branches, fix it. > > Signed-off-by: AlexChen > --- > contrib/elf2dmp

Re: oslib-posix:Fix handle fd leak in qemu_write_pidfile()

2020-08-26 Thread AlexChen
On 2020/8/26 18:18, Daniel P. Berrangé wrote: > On Wed, Aug 26, 2020 at 06:14:48PM +0800, AlexChen wrote: >> > From: alexchen >> > >> > The fd will leak when (a.st_ino == b.st_ino) is true, fix it. > That is *INTENTIONAL*. We're holding a lock on the file a

elf2dmp: Fix memory leak on main() error paths

2020-08-26 Thread AlexChen
From: AlexChen The 'kdgb' is allocating memory in get_kdbg(), but it is not freed in both fill_header() and fill_context() failed branches, fix it. Signed-off-by: AlexChen --- contrib/elf2dmp/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/elf2

oslib-posix:Fix handle fd leak in qemu_write_pidfile()

2020-08-26 Thread AlexChen
From: alexchen The fd will leak when (a.st_ino == b.st_ino) is true, fix it. Signed-off-by: AlexChen --- util/oslib-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index ad8001a4ad..74cf5e9c73 100644 --- a/util/oslib-posix.c +++ b/util/oslib