Skip to content

url: remove superfluous check#21650

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/url-extra-check
Closed

url: remove superfluous check#21650
bagder wants to merge 1 commit into
masterfrom
bagder/url-extra-check

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented May 16, 2026

This pointer is already verified to be non-NULL some 15 lines above.

Pointed out by CodeSonar

This pointer is already verified to be non-NULL some 15 lines above.

Pointed out by CodeSonar
@bagder bagder requested a review from Copilot May 16, 2026 22:32
@bagder bagder marked this pull request as ready for review May 16, 2026 22:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies override_login() in lib/url.c by removing a redundant data->state.creds NULL-check inside a block that already guards on if(data->state.creds).

Changes:

  • Removed an inner else if(data->state.creds) condition and replaced it with a plain else within the CREDS_URL handling path.
  • Keeps behavior identical while eliminating dead/duplicated control flow flagged by static analysis.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in 44ede0c May 16, 2026
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
This pointer is already verified to be non-NULL some 15 lines above.

Pointed out by CodeSonar
Closes curl#21650
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants