mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-17 01:16:06 +00:00
Fix minor resource leak in notifyAudit.
This would leak a response body on each valid, non-200 status response. V12-Ref: F-77171
This commit is contained in:
+1
-1
@@ -337,8 +337,8 @@ func notifyAudit(ctx context.Context, id AuditID) {
|
||||
resp, err := http.Get(notifyURL.String())
|
||||
var body []byte
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
body, _ = io.ReadAll(resp.Body)
|
||||
resp.Body.Close()
|
||||
}
|
||||
if err == nil && resp.StatusCode == http.StatusOK {
|
||||
logc.Printf(ctx, "audit notify %s ok: %s\n", id, string(body))
|
||||
|
||||
Reference in New Issue
Block a user