public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/curl] curl-v8.23.0-3: fix memory leaked by parse_metalink()
Date: Tue, 03 Nov 2026 12:37:35 GMT	[thread overview]
Message-ID: <179370945595.1.10555076438361615685.rpms-curl-e0bf66ef6c40@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/curl
Branch : curl-v8.23.0-3
Commit : e0bf66ef6c403a5f93199b6f5a29105f5e4c244f
Author : Kamil Dudka <kdudka@redhat.com>
Date   : 2019-09-13T10:18:24+02:00
Stats  : +75/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/curl/c/e0bf66ef6c403a5f93199b6f5a29105f5e4c244f?branch=curl-v8.23.0-3

Log:
fix memory leaked by parse_metalink()

---
diff --git a/0001-curl-7.66.0-metalink-memleak.patch b/0001-curl-7.66.0-metalink-memleak.patch
new file mode 100644
index 0000000..16c8ae2
--- /dev/null
+++ b/0001-curl-7.66.0-metalink-memleak.patch
@@ -0,0 +1,71 @@
+From 855ebacdffbc421b121563ae1ecd9fde736bfaf2 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Wed, 11 Sep 2019 16:32:11 +0200
+Subject: [PATCH] curl: fix memory leaked by parse_metalink()
+
+This commit fixes a regression introduced by curl-7_65_3-5-gb88940850.
+Detected by tests 2005, 2008, 2009, 2010, 2011, and 2012 with valgrind
+and libmetalink enabled.
+
+Closes #4326
+
+Upstream-commit: 1ca91bcdb588dc6c25d345f2411fdba314433732
+Signed-off-by: Kamil Dudka <kdudka@redhat.com>
+---
+ src/tool_metalink.c | 2 +-
+ src/tool_metalink.h | 3 +++
+ src/tool_operate.c  | 4 ++++
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/tool_metalink.c b/src/tool_metalink.c
+index 0740407f9..cd5a7d650 100644
+--- a/src/tool_metalink.c
++++ b/src/tool_metalink.c
+@@ -965,7 +965,7 @@ static void delete_metalink_resource(metalink_resource *res)
+   Curl_safefree(res);
+ }
+ 
+-static void delete_metalinkfile(metalinkfile *mlfile)
++void delete_metalinkfile(metalinkfile *mlfile)
+ {
+   metalink_resource *res;
+   if(mlfile == NULL) {
+diff --git a/src/tool_metalink.h b/src/tool_metalink.h
+index 1e367033c..f5ec306f7 100644
+--- a/src/tool_metalink.h
++++ b/src/tool_metalink.h
+@@ -105,6 +105,8 @@ extern const digest_params SHA256_DIGEST_PARAMS[1];
+  * Counts the resource in the metalinkfile.
+  */
+ int count_next_metalink_resource(metalinkfile *mlfile);
++
++void delete_metalinkfile(metalinkfile *mlfile);
+ void clean_metalink(struct OperationConfig *config);
+ 
+ /*
+@@ -158,6 +160,7 @@ void metalink_cleanup(void);
+ #else /* USE_METALINK */
+ 
+ #define count_next_metalink_resource(x)  0
++#define delete_metalinkfile(x)  (void)x
+ #define clean_metalink(x)  (void)x
+ 
+ /* metalink_cleanup() takes no arguments */
+diff --git a/src/tool_operate.c b/src/tool_operate.c
+index d2ad9642d..09dfc0c84 100644
+--- a/src/tool_operate.c
++++ b/src/tool_operate.c
+@@ -2073,6 +2073,10 @@ static CURLcode serial_transfers(struct GlobalConfig *global,
+     result = post_transfer(global, share, per, result, &retry);
+     if(retry)
+       continue;
++
++    /* Release metalink related resources here */
++    delete_metalinkfile(per->mlfile);
++
+     per = del_transfer(per);
+ 
+     /* Bail out upon critical errors or --fail-early */
+-- 
+2.20.1
+

diff --git a/curl.spec b/curl.spec
index 7d8f9f8..62a4980 100644
--- a/curl.spec
+++ b/curl.spec
@@ -5,6 +5,9 @@ Release: 1%{?dist}
 License: MIT
 Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
 
+# fix memory leaked by parse_metalink()
+Patch1:   0001-curl-7.66.0-metalink-memleak.patch
+
 # patch making libcurl multilib ready
 Patch101: 0101-curl-7.32.0-multilib.patch
 
@@ -171,6 +174,7 @@ be installed.
 %setup -q
 
 # upstream patches
+%patch1 -p1
 
 # Fedora patches
 %patch101 -p1

                 reply	other threads:[~2026-11-03 12:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179370945595.1.10555076438361615685.rpms-curl-e0bf66ef6c40@fedoraproject.org \
    --to=kdudka@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox