loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: rpm sign resource leak (#4878)

Fixed the resource leak in #4780.

Related: [go-gitea/gitea#31794](https://github.com/go-gitea/gitea/pull/31794)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4878
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Exploding Dragon <explodingfkl@gmail.com>
Co-committed-by: Exploding Dragon <explodingfkl@gmail.com>

authored by

Exploding Dragon
Exploding Dragon
and committed by
Earl Warren
1bc98642 abc3364a

+3 -1
+3 -1
routers/api/packages/rpm/rpm.go
··· 139 139 apiError(ctx, http.StatusInternalServerError, err) 140 140 return 141 141 } 142 - buf, err = rpm_service.NewSignedRPMBuffer(buf, pri) 142 + signedBuf, err := rpm_service.NewSignedRPMBuffer(buf, pri) 143 143 if err != nil { 144 144 // Not in rpm format, parsing failed. 145 145 apiError(ctx, http.StatusBadRequest, err) 146 146 return 147 147 } 148 + defer signedBuf.Close() 149 + buf = signedBuf 148 150 } 149 151 150 152 pck, err := rpm_module.ParsePackage(buf)