From: David Carlier <[email protected]>

In da_haproxy_checkinst(), when da_atlas_compile() failed, the cnew
buffer was leaked. Add a free(cnew) in the else branch.

This should be backported to lower branches.
---
 addons/deviceatlas/da.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/addons/deviceatlas/da.c b/addons/deviceatlas/da.c
index 88caefa8b..cdd13a73d 100644
--- a/addons/deviceatlas/da.c
+++ b/addons/deviceatlas/da.c
@@ -312,6 +312,8 @@ static void da_haproxy_checkinst(void)
                     ha_alert("deviceatlas : instance update failed.\n");
                     free(cnew);
                 }
+            } else {
+                free(cnew);
             }
 #ifdef USE_THREAD
             HA_SPIN_UNLOCK(OTHER_LOCK, &dadwsch_lock);
-- 
2.51.0



Reply via email to