richardphibel / rpms / librepo

Forked from rpms/librepo 2 years ago
Clone
eee3b5
From 678803b825fea10e4915a300f0e2fc990b7c99fd Mon Sep 17 00:00:00 2001
eee3b5
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hr=C3=A1zk=C3=BD?= <lhrazky@redhat.com>
eee3b5
Date: Thu, 21 Jul 2022 10:11:17 +0200
eee3b5
Subject: [PATCH] More covscan fixes
eee3b5
eee3b5
---
eee3b5
 librepo/metadata_downloader.c | 18 +++++++++---------
eee3b5
 librepo/metalink.c            |  2 +-
eee3b5
 librepo/repomd.c              |  2 +-
eee3b5
 librepo/xmlparser.c           |  4 ++--
eee3b5
 librepo/xmlparser_internal.h  |  2 +-
eee3b5
 librepo/yum.c                 | 32 ++++++++++++++++----------------
eee3b5
 tests/test_checksum.c         | 10 +++++-----
eee3b5
 tests/test_downloader.c       | 16 ++++++++--------
eee3b5
 tests/test_metalink.c         | 18 +++++++++---------
eee3b5
 tests/test_mirrorlist.c       |  6 +++---
eee3b5
 tests/test_util.c             | 16 ++++++++--------
eee3b5
 11 files changed, 63 insertions(+), 63 deletions(-)
eee3b5
eee3b5
diff --git a/librepo/metadata_downloader.c b/librepo/metadata_downloader.c
eee3b5
index be6fe68..9e7d7e5 100644
eee3b5
--- a/librepo/metadata_downloader.c
eee3b5
+++ b/librepo/metadata_downloader.c
eee3b5
@@ -192,7 +192,7 @@ handle_failure(LrMetadataTarget *target,
eee3b5
                GSList **paths,
eee3b5
                GError *err)
eee3b5
 {
eee3b5
-    lr_metadatatarget_append_error(target, err->message, NULL);
eee3b5
+    lr_metadatatarget_append_error(target, err->message);
eee3b5
     fillInvalidationValues(fd_list, paths);
eee3b5
     g_error_free(err);
eee3b5
 }
eee3b5
@@ -221,13 +221,13 @@ create_repomd_xml_download_targets(GSList *targets,
eee3b5
         handle = target->handle;
eee3b5
 
eee3b5
         if (!handle->urls && !handle->mirrorlisturl && !handle->metalinkurl) {
eee3b5
-            lr_metadatatarget_append_error(target, "No LRO_URLS, LRO_MIRRORLISTURL nor LRO_METALINKURL specified", NULL);
eee3b5
+            lr_metadatatarget_append_error(target, "No LRO_URLS, LRO_MIRRORLISTURL nor LRO_METALINKURL specified");
eee3b5
             fillInvalidationValues(fd_list, paths);
eee3b5
             continue;
eee3b5
         }
eee3b5
 
eee3b5
         if (handle->repotype != LR_YUMREPO) {
eee3b5
-            lr_metadatatarget_append_error(target, "Bad LRO_REPOTYPE specified", NULL);
eee3b5
+            lr_metadatatarget_append_error(target, "Bad LRO_REPOTYPE specified");
eee3b5
             fillInvalidationValues(fd_list, paths);
eee3b5
             continue;
eee3b5
         }
eee3b5
@@ -242,14 +242,14 @@ create_repomd_xml_download_targets(GSList *targets,
eee3b5
         if (!lr_handle_prepare_internal_mirrorlist(handle,
eee3b5
                                                    handle->fastestmirror,
eee3b5
                                                    &err)) {
eee3b5
-            lr_metadatatarget_append_error(target, "Cannot prepare internal mirrorlist: %s", err->message, NULL);
eee3b5
+            lr_metadatatarget_append_error(target, "Cannot prepare internal mirrorlist: %s", err->message);
eee3b5
             fillInvalidationValues(fd_list, paths);
eee3b5
             g_error_free(err);
eee3b5
             continue;
eee3b5
         }
eee3b5
 
eee3b5
         if (mkdir(handle->destdir, S_IRWXU) == -1 && errno != EEXIST) {
eee3b5
-            lr_metadatatarget_append_error(target, "Cannot create tmpdir: %s %s", handle->destdir, g_strerror(errno), NULL);
eee3b5
+            lr_metadatatarget_append_error(target, "Cannot create tmpdir: %s %s", handle->destdir, g_strerror(errno));
eee3b5
             fillInvalidationValues(fd_list, paths);
eee3b5
             g_error_free(err);
eee3b5
             continue;
eee3b5
@@ -335,12 +335,12 @@ process_repomd_xml(GSList *targets,
eee3b5
         handle->gnupghomedir = g_strdup(target->gnupghomedir);
eee3b5
 
eee3b5
         if (target->download_target->rcode != LRE_OK) {
eee3b5
-            lr_metadatatarget_append_error(target, (char *) lr_strerror(target->download_target->rcode), NULL);
eee3b5
+            lr_metadatatarget_append_error(target, (char *) lr_strerror(target->download_target->rcode));
eee3b5
             goto fail;
eee3b5
         }
eee3b5
 
eee3b5
         if (!lr_check_repomd_xml_asc_availability(handle, target->repo, fd_value, path->data, &error)) {
eee3b5
-            lr_metadatatarget_append_error(target, error->message, NULL);
eee3b5
+            lr_metadatatarget_append_error(target, error->message);
eee3b5
             g_error_free(error);
eee3b5
             goto fail;
eee3b5
         }
eee3b5
@@ -349,7 +349,7 @@ process_repomd_xml(GSList *targets,
eee3b5
         ret = lr_yum_repomd_parse_file(target->repomd, fd_value, lr_xml_parser_warning_logger,
eee3b5
                                        "Repomd xml parser", &error);
eee3b5
         if (!ret) {
eee3b5
-            lr_metadatatarget_append_error(target, "Parsing unsuccessful: %s", error->message, NULL);
eee3b5
+            lr_metadatatarget_append_error(target, "Parsing unsuccessful: %s", error->message);
eee3b5
             g_error_free(error);
eee3b5
             goto fail;
eee3b5
         }
eee3b5
@@ -377,7 +377,7 @@ lr_metadata_download_cleanup(GSList *download_targets)
eee3b5
         LrDownloadTarget *download_target = elem->data;
eee3b5
         LrMetadataTarget *target = download_target->userdata;
eee3b5
         if (download_target->err)
eee3b5
-            lr_metadatatarget_append_error(target, download_target->err, NULL);
eee3b5
+            lr_metadatatarget_append_error(target, download_target->err);
eee3b5
 
eee3b5
         if (target->err != NULL) {
eee3b5
             ret = FALSE;
eee3b5
diff --git a/librepo/metalink.c b/librepo/metalink.c
eee3b5
index 0f939de..1f839a9 100644
eee3b5
--- a/librepo/metalink.c
eee3b5
+++ b/librepo/metalink.c
eee3b5
@@ -504,7 +504,7 @@ lr_metalink_parse_file(LrMetalink *metalink,
eee3b5
 
eee3b5
     // Parsing
eee3b5
 
eee3b5
-    ret = lr_xml_parser_generic(parser, pd, fd, &tmp_err);
eee3b5
+    ret = lr_xml_parser_generic(&parser, pd, fd, &tmp_err);
eee3b5
     if (tmp_err) {
eee3b5
         g_propagate_error(err, tmp_err);
eee3b5
         goto err;
eee3b5
diff --git a/librepo/repomd.c b/librepo/repomd.c
eee3b5
index f0fd2ad..2905749 100644
eee3b5
--- a/librepo/repomd.c
eee3b5
+++ b/librepo/repomd.c
eee3b5
@@ -570,7 +570,7 @@ lr_yum_repomd_parse_file(LrYumRepoMd *repomd,
eee3b5
 
eee3b5
     // Parsing
eee3b5
 
eee3b5
-    ret = lr_xml_parser_generic(parser, pd, fd, &tmp_err);
eee3b5
+    ret = lr_xml_parser_generic(&parser, pd, fd, &tmp_err);
eee3b5
     if (tmp_err)
eee3b5
         g_propagate_error(err, tmp_err);
eee3b5
 
eee3b5
diff --git a/librepo/xmlparser.c b/librepo/xmlparser.c
eee3b5
index 793c272..88d16aa 100644
eee3b5
--- a/librepo/xmlparser.c
eee3b5
+++ b/librepo/xmlparser.c
eee3b5
@@ -143,7 +143,7 @@ lr_xml_parser_strtoll(LrParserData *pd,
eee3b5
 }
eee3b5
 
eee3b5
 gboolean
eee3b5
-lr_xml_parser_generic(XmlParser parser,
eee3b5
+lr_xml_parser_generic(XmlParser *parser,
eee3b5
                       LrParserData *pd,
eee3b5
                       int fd,
eee3b5
                       GError **err)
eee3b5
@@ -151,7 +151,7 @@ lr_xml_parser_generic(XmlParser parser,
eee3b5
     /* Note: This function uses .err members of LrParserData! */
eee3b5
 
eee3b5
     gboolean ret = TRUE;
eee3b5
-    xmlParserCtxtPtr ctxt = xmlCreatePushParserCtxt(&parser, pd, NULL, 0, NULL);
eee3b5
+    xmlParserCtxtPtr ctxt = xmlCreatePushParserCtxt(parser, pd, NULL, 0, NULL);
eee3b5
     ctxt->linenumbers = 1;
eee3b5
 
eee3b5
     assert(ctxt);
eee3b5
diff --git a/librepo/xmlparser_internal.h b/librepo/xmlparser_internal.h
eee3b5
index c9bacac..25a48a5 100644
eee3b5
--- a/librepo/xmlparser_internal.h
eee3b5
+++ b/librepo/xmlparser_internal.h
eee3b5
@@ -159,7 +159,7 @@ lr_xml_parser_strtoll(LrParserData *pd,
eee3b5
 /** Generic parser.
eee3b5
  */
eee3b5
 gboolean
eee3b5
-lr_xml_parser_generic(XmlParser parser,
eee3b5
+lr_xml_parser_generic(XmlParser *parser,
eee3b5
                       LrParserData *pd,
eee3b5
                       int fd,
eee3b5
                       GError **err);
eee3b5
diff --git a/librepo/yum.c b/librepo/yum.c
eee3b5
index 3b287cd..56bca3e 100644
eee3b5
--- a/librepo/yum.c
eee3b5
+++ b/librepo/yum.c
eee3b5
@@ -335,7 +335,7 @@ lr_prepare_repodata_dir(LrHandle *handle,
eee3b5
             return FALSE;
eee3b5
         }
eee3b5
     }
eee3b5
-    lr_free(path_to_repodata);
eee3b5
+    g_free(path_to_repodata);
eee3b5
 
eee3b5
     return TRUE;
eee3b5
 }
eee3b5
@@ -356,7 +356,7 @@ lr_store_mirrorlist_files(LrHandle *handle,
eee3b5
             g_debug("%s: Cannot create: %s", __func__, ml_file_path);
eee3b5
             g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                         "Cannot create %s: %s", ml_file_path, g_strerror(errno));
eee3b5
-            lr_free(ml_file_path);
eee3b5
+            g_free(ml_file_path);
eee3b5
             return FALSE;
eee3b5
         }
eee3b5
         rc = lr_copy_content(handle->mirrorlist_fd, fd);
eee3b5
@@ -366,7 +366,7 @@ lr_store_mirrorlist_files(LrHandle *handle,
eee3b5
             g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                         "Cannot copy content of mirrorlist file %s: %s",
eee3b5
                         ml_file_path, g_strerror(errno));
eee3b5
-            lr_free(ml_file_path);
eee3b5
+            g_free(ml_file_path);
eee3b5
             return FALSE;
eee3b5
         }
eee3b5
         repo->mirrorlist = ml_file_path;
eee3b5
@@ -391,7 +391,7 @@ lr_copy_metalink_content(LrHandle *handle,
eee3b5
             g_debug("%s: Cannot create: %s", __func__, ml_file_path);
eee3b5
             g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                         "Cannot create %s: %s", ml_file_path, g_strerror(errno));
eee3b5
-            lr_free(ml_file_path);
eee3b5
+            g_free(ml_file_path);
eee3b5
             return FALSE;
eee3b5
         }
eee3b5
         rc = lr_copy_content(handle->metalink_fd, fd);
eee3b5
@@ -401,7 +401,7 @@ lr_copy_metalink_content(LrHandle *handle,
eee3b5
             g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                         "Cannot copy content of metalink file %s: %s",
eee3b5
                         ml_file_path, g_strerror(errno));
eee3b5
-            lr_free(ml_file_path);
eee3b5
+            g_free(ml_file_path);
eee3b5
             return FALSE;
eee3b5
         }
eee3b5
         repo->metalink = ml_file_path;
eee3b5
@@ -422,7 +422,7 @@ lr_prepare_repomd_xml_file(LrHandle *handle,
eee3b5
     if (fd == -1) {
eee3b5
         g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                     "Cannot open %s: %s", *path, g_strerror(errno));
eee3b5
-        lr_free(*path);
eee3b5
+        g_free(*path);
eee3b5
         return -1;
eee3b5
     }
eee3b5
 
eee3b5
@@ -458,13 +458,13 @@ lr_check_repomd_xml_asc_availability(LrHandle *handle,
eee3b5
             g_debug("%s: Cannot open: %s", __func__, signature);
eee3b5
             g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                         "Cannot open %s: %s", signature, g_strerror(errno));
eee3b5
-            lr_free(signature);
eee3b5
+            g_free(signature);
eee3b5
             return FALSE;
eee3b5
         }
eee3b5
 
eee3b5
         url = lr_pathconcat(handle->used_mirror, "repodata/repomd.xml.asc", NULL);
eee3b5
         ret = lr_download_url(handle, url, fd_sig, &tmp_err);
eee3b5
-        lr_free(url);
eee3b5
+        g_free(url);
eee3b5
         close(fd_sig);
eee3b5
         if (!ret) {
eee3b5
             // Error downloading signature
eee3b5
@@ -474,7 +474,7 @@ lr_check_repomd_xml_asc_availability(LrHandle *handle,
eee3b5
                         "repository does not support GPG verification: %s", tmp_err->message);
eee3b5
             g_clear_error(&tmp_err);
eee3b5
             unlink(signature);
eee3b5
-            lr_free(signature);
eee3b5
+            g_free(signature);
eee3b5
             return FALSE;
eee3b5
         } else {
eee3b5
             // Signature downloaded
eee3b5
@@ -483,7 +483,7 @@ lr_check_repomd_xml_asc_availability(LrHandle *handle,
eee3b5
                                          path,
eee3b5
                                          handle->gnupghomedir,
eee3b5
                                          &tmp_err);
eee3b5
-            lr_free(signature);
eee3b5
+            g_free(signature);
eee3b5
             if (!ret) {
eee3b5
                 g_debug("%s: GPG signature verification failed: %s",
eee3b5
                         __func__, tmp_err->message);
eee3b5
@@ -680,7 +680,7 @@ prepare_repo_download_std_target(LrHandle *handle,
eee3b5
                 __func__, *path, g_strerror(errno));
eee3b5
         g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                     "Cannot create/open %s: %s", *path, g_strerror(errno));
eee3b5
-        lr_free(*path);
eee3b5
+        g_free(*path);
eee3b5
         g_slist_free_full(*targets, (GDestroyNotify) lr_downloadtarget_free);
eee3b5
         return FALSE;
eee3b5
     }
eee3b5
@@ -713,7 +713,7 @@ prepare_repo_download_zck_target(LrHandle *handle,
eee3b5
                 __func__, *path, g_strerror(errno));
eee3b5
         g_set_error(err, LR_YUM_ERROR, LRE_IO,
eee3b5
                     "Cannot create/open %s: %s", *path, g_strerror(errno));
eee3b5
-        lr_free(*path);
eee3b5
+        g_free(*path);
eee3b5
         g_slist_free_full(*targets, (GDestroyNotify) lr_downloadtarget_free);
eee3b5
         return FALSE;
eee3b5
     }
eee3b5
@@ -778,7 +778,7 @@ prepare_repo_download_targets(LrHandle *handle,
eee3b5
         char *dest_dir = realpath(handle->destdir, NULL);
eee3b5
         path = lr_pathconcat(handle->destdir, record->location_href, NULL);
eee3b5
         char *requested_dir = realpath(dirname(path), NULL);
eee3b5
-        lr_free(path);
eee3b5
+        g_free(path);
eee3b5
         if (!g_str_has_prefix(requested_dir, dest_dir)) {
eee3b5
             g_debug("%s: Invalid path: %s", __func__, location_href);
eee3b5
             g_set_error(err, LR_YUM_ERROR, LRE_IO, "Invalid path: %s", location_href);
eee3b5
@@ -850,7 +850,7 @@ prepare_repo_download_targets(LrHandle *handle,
eee3b5
 
eee3b5
         /* Because path may already exists in repo (while update) */
eee3b5
         lr_yum_repo_update(repo, record->type, path);
eee3b5
-        lr_free(path);
eee3b5
+        g_free(path);
eee3b5
     }
eee3b5
 
eee3b5
     return TRUE;
eee3b5
@@ -1130,7 +1130,7 @@ lr_yum_use_local_load_base(LrHandle *handle,
eee3b5
             repo->mirrorlist = mrl_fn;
eee3b5
         } else {
eee3b5
             repo->mirrorlist = NULL;
eee3b5
-            lr_free(mrl_fn);
eee3b5
+            g_free(mrl_fn);
eee3b5
         }
eee3b5
     }
eee3b5
 
eee3b5
@@ -1142,7 +1142,7 @@ lr_yum_use_local_load_base(LrHandle *handle,
eee3b5
             repo->metalink = mtl_fn;
eee3b5
         } else {
eee3b5
             repo->metalink = NULL;
eee3b5
-            lr_free(mtl_fn);
eee3b5
+            g_free(mtl_fn);
eee3b5
         }
eee3b5
     }
eee3b5
 
eee3b5
diff --git a/tests/test_checksum.c b/tests/test_checksum.c
eee3b5
index 264782c..efac88b 100644
eee3b5
--- a/tests/test_checksum.c
eee3b5
+++ b/tests/test_checksum.c
eee3b5
@@ -87,7 +87,7 @@ START_TEST(test_checksum_fd)
eee3b5
     test_checksum(file, LR_CHECKSUM_SHA512, CHKS_VAL_01_SHA512);
eee3b5
 
eee3b5
     ck_assert_msg(remove(file) == 0, "Cannot delete temporary test file");
eee3b5
-    lr_free(file);
eee3b5
+    g_free(file);
eee3b5
 }
eee3b5
 END_TEST
eee3b5
 
eee3b5
@@ -235,9 +235,9 @@ START_TEST(test_cached_checksum_value)
eee3b5
     ck_assert(attr_ret == -1);  // Cached checksum should not exists
eee3b5
 
eee3b5
     lr_free(calculated);
eee3b5
-    lr_free(filename);
eee3b5
-    lr_free(timestamp_key);
eee3b5
-    lr_free(checksum_key);
eee3b5
+    g_free(filename);
eee3b5
+    g_free(timestamp_key);
eee3b5
+    g_free(checksum_key);
eee3b5
     lr_free(mtime_str);
eee3b5
 }
eee3b5
 END_TEST
eee3b5
@@ -294,7 +294,7 @@ START_TEST(test_cached_checksum_clear)
eee3b5
     ck_assert(attr_ret != -1);
eee3b5
 cleanup:
eee3b5
     close(fd);
eee3b5
-    lr_free(filename);
eee3b5
+    g_free(filename);
eee3b5
     g_free(timestamp_key);
eee3b5
     g_free(checksum_key);
eee3b5
 }
eee3b5
diff --git a/tests/test_downloader.c b/tests/test_downloader.c
eee3b5
index 34958ab..a3fff20 100644
eee3b5
--- a/tests/test_downloader.c
eee3b5
+++ b/tests/test_downloader.c
eee3b5
@@ -52,7 +52,7 @@ START_TEST(test_downloader_single_file)
eee3b5
     tmpfn1 = lr_pathconcat(test_globals.tmpdir, "single_file_XXXXXX", NULL);
eee3b5
 
eee3b5
     fd1 = mkstemp(tmpfn1);
eee3b5
-    lr_free(tmpfn1);
eee3b5
+    g_free(tmpfn1);
eee3b5
     ck_assert_int_ge(fd1, 0);
eee3b5
 
eee3b5
     t1 = lr_downloadtarget_new(handle, "index.html", NULL, fd1, NULL, NULL,
eee3b5
@@ -97,7 +97,7 @@ START_TEST(test_downloader_single_file_2)
eee3b5
     tmpfn1 = lr_pathconcat(test_globals.tmpdir, "single_file_2_XXXXXX", NULL);
eee3b5
 
eee3b5
     fd1 = mkstemp(tmpfn1);
eee3b5
-    lr_free(tmpfn1);
eee3b5
+    g_free(tmpfn1);
eee3b5
     ck_assert_int_ge(fd1, 0);
eee3b5
 
eee3b5
     t1 = lr_downloadtarget_new(NULL, "http://seznam.cz/index.html", NULL,
eee3b5
@@ -154,8 +154,8 @@ START_TEST(test_downloader_two_files)
eee3b5
 
eee3b5
     fd1 = mkstemp(tmpfn1);
eee3b5
     fd2 = mkstemp(tmpfn2);
eee3b5
-    lr_free(tmpfn1);
eee3b5
-    lr_free(tmpfn2);
eee3b5
+    g_free(tmpfn1);
eee3b5
+    g_free(tmpfn2);
eee3b5
     ck_assert_int_ge(fd1, 0);
eee3b5
     ck_assert_int_ge(fd2, 0);
eee3b5
 
eee3b5
@@ -223,9 +223,9 @@ START_TEST(test_downloader_three_files_with_error)
eee3b5
     fd1 = mkstemp(tmpfn1);
eee3b5
     fd2 = mkstemp(tmpfn2);
eee3b5
     fd3 = mkstemp(tmpfn3);
eee3b5
-    lr_free(tmpfn1);
eee3b5
-    lr_free(tmpfn2);
eee3b5
-    lr_free(tmpfn3);
eee3b5
+    g_free(tmpfn1);
eee3b5
+    g_free(tmpfn2);
eee3b5
+    g_free(tmpfn3);
eee3b5
     ck_assert_int_ge(fd1, 0);
eee3b5
     ck_assert_int_ge(fd2, 0);
eee3b5
     ck_assert_int_ge(fd3, 0);
eee3b5
@@ -329,7 +329,7 @@ START_TEST(test_downloader_checksum)
eee3b5
         tmpfn1 = lr_pathconcat(test_globals.tmpdir, "single_file_XXXXXX", NULL);
eee3b5
 
eee3b5
         fd1 = mkstemp(tmpfn1);
eee3b5
-        lr_free(tmpfn1);
eee3b5
+        g_free(tmpfn1);
eee3b5
         ck_assert_int_ge(fd1, 0);
eee3b5
 
eee3b5
         checksum = lr_downloadtargetchecksum_new(LR_CHECKSUM_SHA512,
eee3b5
diff --git a/tests/test_metalink.c b/tests/test_metalink.c
eee3b5
index e425742..1440125 100644
eee3b5
--- a/tests/test_metalink.c
eee3b5
+++ b/tests/test_metalink.c
eee3b5
@@ -48,7 +48,7 @@ START_TEST(test_metalink_good_01)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_good_01", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -160,7 +160,7 @@ START_TEST(test_metalink_good_02)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_good_02", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -206,7 +206,7 @@ START_TEST(test_metalink_good_03)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_good_03", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -250,7 +250,7 @@ START_TEST(test_metalink_bad_01)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_bad_01", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -371,7 +371,7 @@ START_TEST(test_metalink_bad_02)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_bad_02", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -395,7 +395,7 @@ START_TEST(test_metalink_really_bad_01)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_really_bad_01", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -419,7 +419,7 @@ START_TEST(test_metalink_really_bad_02)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_really_bad_02", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -443,7 +443,7 @@ START_TEST(test_metalink_really_bad_03)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_really_bad_03", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -470,7 +470,7 @@ START_TEST(test_metalink_with_alternates)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR,
eee3b5
                          "metalink_with_alternates", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_metalink_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
diff --git a/tests/test_mirrorlist.c b/tests/test_mirrorlist.c
eee3b5
index cc00b7f..ec924b6 100644
eee3b5
--- a/tests/test_mirrorlist.c
eee3b5
+++ b/tests/test_mirrorlist.c
eee3b5
@@ -35,7 +35,7 @@ START_TEST(test_mirrorlist_01)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, MIRRORLIST_DIR,
eee3b5
                          "mirrorlist_01", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_mirrorlist_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -68,7 +68,7 @@ START_TEST(test_mirrorlist_02)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, MIRRORLIST_DIR,
eee3b5
                          "mirrorlist_02", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_mirrorlist_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
@@ -92,7 +92,7 @@ START_TEST(test_mirrorlist_03)
eee3b5
     path = lr_pathconcat(test_globals.testdata_dir, MIRRORLIST_DIR,
eee3b5
                          "mirrorlist_03", NULL);
eee3b5
     fd = open(path, O_RDONLY);
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     ck_assert_int_ge(fd, 0);
eee3b5
     ml = lr_mirrorlist_init();
eee3b5
     ck_assert_ptr_nonnull(ml);
eee3b5
diff --git a/tests/test_util.c b/tests/test_util.c
eee3b5
index d082445..96e82aa 100644
eee3b5
--- a/tests/test_util.c
eee3b5
+++ b/tests/test_util.c
eee3b5
@@ -68,43 +68,43 @@ START_TEST(test_pathconcat)
eee3b5
     path = lr_pathconcat("", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 
eee3b5
     path = lr_pathconcat("/tmp", "foo///", "bar", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "/tmp/foo/bar");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 
eee3b5
     path = lr_pathconcat("foo", "bar/", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "foo/bar");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 
eee3b5
     path = lr_pathconcat("foo", "/bar/", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "foo/bar");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 
eee3b5
     path = lr_pathconcat("foo", "bar", "", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "foo/bar/");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 
eee3b5
     path = lr_pathconcat("http://host.net", "path/to/somewhere", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "http://host.net/path/to/somewhere");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 
eee3b5
     path = lr_pathconcat("http://host.net?hello=1", "path/to/", "somewhere", NULL);
eee3b5
     ck_assert_ptr_nonnull(path);
eee3b5
     ck_assert_str_eq(path, "http://host.net/path/to/somewhere?hello=1");
eee3b5
-    lr_free(path);
eee3b5
+    g_free(path);
eee3b5
     path = NULL;
eee3b5
 }
eee3b5
 END_TEST
eee3b5
@@ -127,7 +127,7 @@ START_TEST(test_remove_dir)
eee3b5
     ck_assert_int_ne(unlink(tmp_file), 0);
eee3b5
     ck_assert_int_ne(rmdir(tmp_dir), 0);
eee3b5
     g_free(tmp_dir);
eee3b5
-    lr_free(tmp_file);
eee3b5
+    g_free(tmp_file);
eee3b5
 }
eee3b5
 END_TEST
eee3b5
 
eee3b5
-- 
eee3b5
2.37.1
eee3b5