web: fix query handle leak

IndexResource and IncompleteURLRedirectResource handlers opened a
BerkeleyDB query handle but never called query.close(), leaking file
descriptors on every redirect request.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
This commit is contained in:
Thomas Perrot 2026-05-05 17:36:26 +02:00 committed by Théo Lebrun
parent 453580252b
commit a54519731f

View file

@ -210,6 +210,7 @@ class IndexResource:
status=falcon.HTTP_INTERNAL_SERVER_ERROR)
version = query.get_latest_tag(rc=False)
query.close()
resp.status = falcon.HTTP_FOUND
resp.location = stringify_source_path(project, version, '/')
return
@ -366,6 +367,7 @@ class IncompleteURLRedirectResource:
rc = version == 'latest-rc'
version = query.get_latest_tag(rc=rc)
query.close()
resp.status = falcon.HTTP_FOUND
resp.location = stringify_source_path(project, version, '/')