LP#1974193: fix memory leak in C apps user/dyrcona/lp1974193_fix_memory_leak-signoff
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 19 May 2022 13:44:05 +0000 (09:44 -0400)
committerJason Stephenson <jason@sigio.com>
Fri, 20 May 2022 18:13:54 +0000 (14:13 -0400)
commitfed05f9a9821949fb9c0e437c6c3888516ff3eb9
treed0864231133041f6ac7f19758b3fbc58755792c3
parent42eddc6429a7768a573b5d51d5fed6f381a55cff
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