Skip to contentSkip to conversation

wispr: Fix leak of earlier redirect URLs

PATCH New Grant Erickson 1 participant 1 message Nov 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wispr: Fix leak of earlier redirect URLs

When an online check response is a redirect that wispr follows, wispr_portal_web_result_success records the redirect target in wp_context->redirect_url, replacing any earlier value without freeing it. The value is freed when the WISPr/portal context is freed, so a context that follows a single redirect does not leak. One that follows a chain of two or more redirects leaks every target but the last.

Free the earlier value before recording the new one.

---
 src/wispr.c | 1 +
 1 file changed, 1 insertion(+)
src/wispr.c +1 -0
index a40cf353b54e..64c5639d59ef 100644
@@ -1111,6 +1111,7 @@ static void wispr_portal_web_result_success(GWebResult *result,
 
 		DBG("Redirect URL: %s", redirect);
 
+		g_free(wp_context->redirect_url);
 		wp_context->redirect_url = g_strdup(redirect);
 
 		wispr_portal_context_ref(wp_context);
Signature · 1 line
2.52.0