LP#1974193: fix memory leak in C apps
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 19 May 2022 13:44:05 +0000 (09:44 -0400)
committerJason Stephenson <jason@sigio.com>
Tue, 31 May 2022 14:25:42 +0000 (10:25 -0400)
commit37282ddf6cada0f32988558f3763de0485649dfc
tree0bb3870b87086789f7dc30c2ca2dea33082a51eb
parentcd44561e7fe7af13a891be488a851185201f0aad
LP#1974193: fix memory leak in C apps

This patch fixes a memory leak that can occur when
a C app does the following:

- send a non-chunked response
- add a response to a bundle to send later
- send a request complete status message

The leak could add up for long-lived C apps.

To test
-------
[1] Set a up C app such as Evergreen's open-ils.pcrud and
    send a lot of requests to it whose responses would not be
    large enough to be chunked, but not so many as to go over
    max_requests. It may be helpful to limit the service to
    just a single child.
[2] Check memory usage of the child after the requests are
    processed.
[3] Apply the patch and repeat step 1. This time, memory
    usage should be less.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
src/libopensrf/osrf_application.c