On 3/14/24 04:31, Duan, Zhenzhong wrote:


-----Original Message-----
From: Cédric Le Goater <c...@redhat.com>
Sent: Thursday, March 14, 2024 5:06 AM
To: qemu-devel@nongnu.org
Cc: Alex Williamson <alex.william...@redhat.com>; Cédric Le Goater
<c...@redhat.com>; Eric Auger <eric.au...@redhat.com>; Liu, Yi L
<yi.l....@intel.com>; Duan, Zhenzhong <zhenzhong.d...@intel.com>
Subject: [PATCH] vfio/iommufd: Fix memory leak

Make sure variable contents is freed if scanf fails.

Cc: Eric Auger <eric.au...@redhat.com>
Cc: Yi Liu <yi.l....@intel.com>
Cc: Zhenzhong Duan <zhenzhong.d...@intel.com>
Fixes: CID 1540007
Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend")
Signed-off-by: Cédric Le Goater <c...@redhat.com>

Reviewed-by: Zhenzhong Duan <zhenzhong.d...@intel.com>

Unrelated to this patch, I see there are four g_free calls, not clear if it's 
deserved
to cleanup with g_autofree.

Ah yes. This is much better indeed.


Thanks,

C.




Reply via email to