[gnome-epub-thumbnailer/wip/hadess/epub-workaround: 3/6] epub: Use g_autofree for root_file




commit 56630b943f7587465cb634fb3cc24016cdcc5ade
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 28 17:16:07 2022 +0200

    epub: Use g_autofree for root_file

 gnome-epub-thumbnailer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gnome-epub-thumbnailer.c b/gnome-epub-thumbnailer.c
index a747b63..eb1e110 100644
--- a/gnome-epub-thumbnailer.c
+++ b/gnome-epub-thumbnailer.c
@@ -213,7 +213,7 @@ get_cover_path_from_root_file (const char *metafile,
        xmlDocPtr doc;
        xmlXPathContextPtr xpath_ctx;
        g_autofree char *root_path = NULL;
-       char *root_file;
+       g_autofree char *root_file = NULL;
        gsize root_length;
        char *cover_path, *full_cover_path;
 
@@ -231,7 +231,6 @@ get_cover_path_from_root_file (const char *metafile,
                g_debug ("#### '%s' contents ####\n%s", root_path, root_file);
 
        doc = open_doc (root_file, root_length, "package");
-       g_free (root_file);
        if (!doc)
                return NULL;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]