summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0009-Workaround-Fix-memory-leak.patch
blob: 90905762b8c6a3bd3220e64a6af79a0c74842f01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From f43d6ba7e32565a7881949070bd25cb13f50ebf7 Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Thu, 27 Aug 2020 13:56:52 -0700
Subject: [PATCH 1/1] Workaround: Fix memory leak

Req caputures self not allowing the connection to
be freed. There is discussion in upstream about a
real fix, this should be kept downstream only.

Tested: Sent 1000 connections, saw no VSZ increase

Change-Id: I63440abbe0882ffe228395b5d3bc869f10048ddc
Signed-off-by: James Feist <james.feist@linux.intel.com>
---
 http/http_connection.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/http/http_connection.h b/http/http_connection.h
index 109a272..393c2e7 100644
--- a/http/http_connection.h
+++ b/http/http_connection.h
@@ -422,6 +422,8 @@ class Connection :
         {
             adaptor.close();
         }
+        // HACK TO REMOVE MEMORY LEAK
+        req.reset();
     }
 
     void completeRequest()
-- 
2.17.1