]> git.evergreen-ils.org Git - working/OpenSRF.git/commit
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:26:02 +0000 (10:26 -0400)
commit9fa5fbbd05d2ade6a6359c16ff6056561fbeca51
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