Acked-by: Christophe Fergeau <cferg...@redhat.com>

On Fri, Sep 21, 2018 at 11:13:45AM +0200, Fabiano Fidêncio wrote:
> In osinfo_db_create_file() g_file_query_info() may fail which will leave
> @info as a NULL and we'll try to free it in the cleanup causing:
> (osinfo-db-export:32261): GLib-GObject-CRITICAL **: 11:00:08.488: 
> g_object_unref: assertion 'G_IS_OBJECT (object)' failed
> 
> In order to avoid that, let's only call g_object_unref() when @info is
> not NULL.
> 
> Signed-off-by: Fabiano Fidêncio <fiden...@redhat.com>
> ---
>  tools/osinfo-db-export.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/osinfo-db-export.c b/tools/osinfo-db-export.c
> index 2c1bb8d..820196f 100644
> --- a/tools/osinfo-db-export.c
> +++ b/tools/osinfo-db-export.c
> @@ -286,7 +286,8 @@ static int osinfo_db_export_create_file(const gchar 
> *prefix,
>      g_free(abspath);
>      g_free(relpath);
>      g_free(entpath);
> -    g_object_unref(info);
> +    if (info)
> +        g_object_unref(info);
>      if (err)
>          g_error_free(err);
>      return ret;
> -- 
> 2.17.1
> 
> _______________________________________________
> Libosinfo mailing list
> Libosinfo@redhat.com
> https://www.redhat.com/mailman/listinfo/libosinfo

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Libosinfo mailing list
Libosinfo@redhat.com
https://www.redhat.com/mailman/listinfo/libosinfo

Reply via email to