Blame SOURCES/0012-Issue-50984-Memory-leaks-in-disk-monitoring.patch

5873fa
From 2540354b7eb6fa03db7d36a5b755001b0852aa1b Mon Sep 17 00:00:00 2001
5873fa
From: Simon Pichugin <spichugi@redhat.com>
5873fa
Date: Thu, 26 Mar 2020 19:33:47 +0100
5873fa
Subject: [PATCH] Issue 50984 - Memory leaks in disk monitoring
5873fa
5873fa
Description: Memory leaks are reported by the disk monitoring test suite.
5873fa
The direct leak is related to char **dirs array which is not freed at all.
5873fa
Free the array when we clean up or go to shutdown.
5873fa
Fix disk_monitoring_test.py::test_below_half_of_the_threshold_not_starting_after_shutdown.
5873fa
It should accept different exception when the instance is not started.
5873fa
5873fa
https://pagure.io/389-ds-base/issue/50984
5873fa
5873fa
Reviewed by: firstyear (Thanks!)
5873fa
---
5873fa
 ldap/servers/slapd/daemon.c | 2 --
5873fa
 ldap/servers/slapd/main.c   | 1 -
5873fa
 2 files changed, 3 deletions(-)
5873fa
5873fa
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
5873fa
index a70f40316..542d31037 100644
5873fa
--- a/ldap/servers/slapd/daemon.c
5873fa
+++ b/ldap/servers/slapd/daemon.c
5873fa
@@ -613,7 +613,6 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
5873fa
                         }
5873fa
                     }
5873fa
                     slapi_ch_array_free(dirs);
5873fa
-                    dirs = NULL;
5873fa
                     return;
5873fa
                 }
5873fa
                 /*
5873fa
@@ -713,7 +712,6 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
5873fa
             }
5873fa
         }
5873fa
         slapi_ch_array_free(dirs);
5873fa
-        dirs = NULL; /* now it is not needed but the code may be changed in the future and it'd better be more robust */
5873fa
         g_set_shutdown(SLAPI_SHUTDOWN_DISKFULL);
5873fa
         return;
5873fa
 }
5873fa
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
5873fa
index e54b8e1c5..1f8b01959 100644
5873fa
--- a/ldap/servers/slapd/main.c
5873fa
+++ b/ldap/servers/slapd/main.c
5873fa
@@ -958,7 +958,6 @@ main(int argc, char **argv)
5873fa
             goto cleanup;
5873fa
         }
5873fa
         slapi_ch_array_free(dirs);
5873fa
-        dirs = NULL;
5873fa
     }
5873fa
     /* log the max fd limit as it is typically set in env/systemd */
5873fa
     slapi_log_err(SLAPI_LOG_INFO, "main",
5873fa
-- 
5873fa
2.26.2
5873fa