> Subject: [Qemu-devel] [PATCH] qom: suppress conscan warning of returning null
> point
> 
> Conscan complains about g_malloc0() and malloc() return null.
> 
>   Error: NULL_RETURNS (CWE-476):
>   qemu-kvm/qom/object.c:239: returned_null: Function "g_malloc0(gsize)"
> returns null.
>   qemu-kvm/qom/object.c:239: var_assigned: Assigning: "ti->class" = null
> return value from "g_malloc0(gsize)".
>   qemu-kvm/qom/object.c:249: dereference: Dereferencing a null pointer
> "ti->class".
> 
> But if the passed size parameter is >= 1, then we can always get an
> effective pointer, the warning disappears.
> 
> Signed-off-by: Amos Kong <ak...@redhat.com>
> ---
>  qom/object.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Gonglei <arei.gong...@huawei.com>

Best regards,
-Gonglei




Reply via email to