Skip to content

fix(websocket): Fix leaking user_info if strdup for user or pass fails#1040

Open
rtrbt wants to merge 1 commit intoespressif:masterfrom
rtrbt:patch-1
Open

fix(websocket): Fix leaking user_info if strdup for user or pass fails#1040
rtrbt wants to merge 1 commit intoespressif:masterfrom
rtrbt:patch-1

Conversation

@rtrbt
Copy link
Copy Markdown

@rtrbt rtrbt commented Apr 1, 2026

Note

Low Risk
Low risk: small, localized change that only affects the error path when allocating username/password from a URI fails, preventing a memory leak.

Overview
Fixes a memory leak in esp_websocket_client_set_uri() when parsing userinfo from the URI: if strdup() fails for the extracted username or password, the temporary user_info buffer is now freed before returning ESP_ERR_NO_MEM.

Written by Cursor Bugbot for commit a79f77c. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants