linkedin / ambry

Distributed object store
https://github.com/linkedin/ambry/wiki
Apache License 2.0
1.74k stars 275 forks source link

[Frontend] Fix memory leak in 100-continue feature #2780

Closed snalli closed 4 months ago

snalli commented 4 months ago

This patch fixes a memory bloat issue in 100-continue feature.

First, the if-clause to handle 100-continue should be success && (a || b || c) but was this success && (a || b) || c.

Second, the Response wasn't linked to Request. As a result, the Request is dangling and not released into the heap causing memory leak. In the future, the Request could be accepted as constructor arg to Response to avoid null pointers.