From: Ed Rose | Tewke <ed@tewke.com>
To: "connman@lists.linux.dev" <connman@lists.linux.dev>
Cc: Ed Rose | Tewke <ed@tewke.com>
Subject: [PATCH 1/2] wispr: Ensure memory cleaned up in all cases
Date: Thu, 12 Mar 2026 15:14:57 +0000 [thread overview]
Message-ID: <20260312151445.720413-4-ed@tewke.com> (raw)
In-Reply-To: <20260312151445.720413-2-ed@tewke.com>
If `connman_proxy_lookup` fails to resolve a proxy, the code path fails
to unref the `connman_wispr_portal_context` resulting in a resource
leak of both memory and file descriptors. This can lead to connman
hitting it's OS fd limit and becoming non-functional.
Resolve this by ensuring the reference count for the portal context is
always decremented, even in error cases.
---
src/wispr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/wispr.c b/src/wispr.c
index a40cf353..a8e16b7e 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -1303,7 +1303,7 @@ static void proxy_callback(const char *proxy, void *user_data)
portal_manage_failure_status(wp_context, 0, "no valid proxy");
- return;
+ goto done;
}
DBG("proxy %s", proxy);
@@ -1328,6 +1328,7 @@ static void proxy_callback(const char *proxy, void *user_data)
xml_wispr_parser_callback, wp_context);
wispr_portal_request_portal(wp_context);
+done:
wispr_portal_context_unref(wp_context);
}
--
2.43.0
next prev parent reply other threads:[~2026-03-12 15:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 15:14 [PATCH 0/2] Resource leaks and Asus routers Ed Rose | Tewke
2026-03-12 15:14 ` Ed Rose | Tewke [this message]
2026-03-12 15:15 ` [PATCH 2/2] dhcp: Ignore empty DHCP Option 252 Ed Rose | Tewke
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=20260312151445.720413-4-ed@tewke.com \
--to=ed@tewke.com \
--cc=connman@lists.linux.dev \
/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