On Thu, Apr 03, 2025 at 11:58:34AM +0100, Richard W.M. Jones via Libguestfs 
wrote:
> diff --git a/mltools/libosinfo-c.c b/mltools/libosinfo-c.c
> index 11df1fe..00d74c1 100644
> --- a/mltools/libosinfo-c.c
> +++ b/mltools/libosinfo-c.c
> @@ -164,17 +164,22 @@ v2v_osinfo_os_find_os_by_short_id (value dbv, value osv)
>  
>    os_list = osinfo_db_get_os_list (OsinfoDb_t_val (dbv));
>    filter = osinfo_filter_new ();
> -  osinfo_filter_add_constraint (filter, OSINFO_PRODUCT_PROP_SHORT_ID, 
> String_val (osv));
> +  osinfo_filter_add_constraint (filter, OSINFO_PRODUCT_PROP_SHORT_ID,
> +                                String_val (osv));
>    list = osinfo_list_new_filtered (OSINFO_LIST(os_list), filter);
>  
>    if (osinfo_list_get_length (list) == 0) {
>      g_object_unref (list);
> +    g_object_unref (filter);
> +    g_object_unref (os_list);
>      caml_raise_not_found ();
>    }
>  
>    os = OSINFO_OS(osinfo_list_get_nth (list, 0));
>    rv = Val_OsinfoOs_t (dbv, os);
>    g_object_unref (list);
> +  g_object_unref (filter);
> +  g_object_unref (os_list);
>  
>    CAMLreturn (rv);
>  }

Actually this is wrong as the pointers are using g_autoptr.

I still don't understand why valgrind is failing.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org
_______________________________________________
Libguestfs mailing list -- guestfs@lists.libguestfs.org
To unsubscribe send an email to guestfs-le...@lists.libguestfs.org

Reply via email to