File: range-test-Fix-a-memory-leak.patch

package info (click to toggle)
libsoup3 3.6.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,568 kB
  • sloc: ansic: 61,978; python: 202; xml: 97; sh: 84; makefile: 32; javascript: 5
file content (24 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Milan Crha <mcrha@redhat.com>
Date: Thu, 22 May 2025 11:05:35 +0200
Subject: range-test: Fix a memory leak

The 'succeed' is an argument, set by the caller, which does not mean
the 'body' cannot be set to some data.

Origin: upstream, 3.7.0, commit:1e90797e2575d8b27e0431c03df5a4cbd4713b76
---
 tests/range-test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/range-test.c b/tests/range-test.c
index 83cf717..5fb1d7a 100644
--- a/tests/range-test.c
+++ b/tests/range-test.c
@@ -82,6 +82,7 @@ do_single_range (SoupSession *session, SoupMessage *msg,
 				debug_printf (1, "    Content-Range: %s\n", content_range);
 		}
 
+		g_clear_pointer (&body, g_bytes_unref);
 		g_object_unref (msg);
 		return;
 	}