- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.8k
 
Open
Description
Problem
Two potential issues identified in plugins/out_http/http.c:
- NULL dereference risk: 
flb_http_client()can return NULL, but the code immediately dereferencesc->proxy.hostwithout checking - Memory leak on early return: When 
http_request()returns beforeappend_headers(), header strings allocated byextract_headers()are leaked 
Location
- File: 
plugins/out_http/http.c - Function: 
http_request()(formerlyhttp_post()) - Lines: ~175-181 and cleanup section
 
Solution
- Add NULL check after 
flb_http_client()call - Free header strings on early return path
 - Guard client destruction with NULL check
 
Context
- Identified during review of PR out_http: Added PUT support #10882 (PUT support implementation)
 - Issue discussion: out_http: Added PUT support #10882 (comment)
 - Reporter: @nicknezis
 
Impact
- Severity: Medium (potential crash on client creation failure)
 - Frequency: Low (depends on memory pressure/network conditions)
 
Metadata
Metadata
Assignees
Labels
No labels