Skip to content

Fix: free performance body before overwriting it - #1155

Open
mattmundell wants to merge 3 commits into
mainfrom
fix/69-openvasd-get-performance-response-body-overwritten-on-both-success-and-error-branche
Open

mattmundell wants to merge 3 commits into
mainfrom
fix/69-openvasd-get-performance-response-body-overwritten-on-both-success-and-error-branche

Conversation

@mattmundell

Copy link
Copy Markdown
Contributor

What

Free response->body with g_free before overwriting it in both the success
and error branches of openvasd_get_performance() (openvasd/openvasd.c).

Why

Both branches assigned a new string over the body returned by
http_scanner_send_request() without freeing it, so that allocation leaked on
every call, successful or not.

Testing

  • openvasd_get_performance_frees_body_on_success (openvasd-test): before the
    fix, LeakSanitizer reported a 16-byte direct leak allocated by
    http_scanner_send_request (http_scanner/http_scanner.c:478); after, the
    case passes with no leak report.
  • openvasd_get_performance_frees_body_on_error (openvasd-test): before the
    fix, LeakSanitizer reported a 35-byte direct leak allocated by
    http_scanner_send_request (http_scanner/http_scanner.c:469); after, the
    case passes with no leak report.

The body from http_scanner_send_request() leaked on every success.
The body from http_scanner_send_request() leaked on every error.
@mattmundell
mattmundell requested review from a team as code owners October 22, 2026 12:04
@greenbonebot
greenbonebot enabled auto-merge (rebase) October 22, 2026 12:04
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 8580ebe.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant