richardphibel / rpms / librepo

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