|
|
8394b4 |
From 0513da63603cfc5730d34cc10aaf3a23beec210c Mon Sep 17 00:00:00 2001
|
|
|
8394b4 |
From: Mark Reynolds <mreynolds@redhat.com>
|
|
|
8394b4 |
Date: Thu, 16 Jan 2020 15:11:34 -0500
|
|
|
8394b4 |
Subject: [PATCH] Issue 50599 - Fix memory leak when removing db region files
|
|
|
8394b4 |
|
|
|
8394b4 |
Description: An unnecessary flag was set in glob() that was resulting
|
|
|
8394b4 |
in a memory leak in the DS code. Removing this flag
|
|
|
8394b4 |
eliminated the leak.
|
|
|
8394b4 |
|
|
|
8394b4 |
relates: https://pagure.io/389-ds-base/issue/50599
|
|
|
8394b4 |
|
|
|
8394b4 |
Reviewed by:
|
|
|
8394b4 |
---
|
|
|
8394b4 |
ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c | 2 +-
|
|
|
8394b4 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
8394b4 |
|
|
|
8394b4 |
diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
|
|
|
8394b4 |
index 2103dac38..5a6a2a2e5 100644
|
|
|
8394b4 |
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
|
|
|
8394b4 |
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
|
|
|
8394b4 |
@@ -1072,7 +1072,7 @@ bdb_start(struct ldbminfo *li, int dbmode)
|
|
|
8394b4 |
|
|
|
8394b4 |
/* Better wipe out the region files to help ensure a clean start */
|
|
|
8394b4 |
PR_snprintf(file_pattern, MAXPATHLEN, "%s/%s", region_dir, "__db.*");
|
|
|
8394b4 |
- if (glob(file_pattern, GLOB_DOOFFS, NULL, &globbuf) == 0) {
|
|
|
8394b4 |
+ if (glob(file_pattern, 0, NULL, &globbuf) == 0) {
|
|
|
8394b4 |
for (size_t i = 0; i < globbuf.gl_pathc; i++) {
|
|
|
8394b4 |
remove(globbuf.gl_pathv[i]);
|
|
|
8394b4 |
}
|
|
|
8394b4 |
--
|
|
|
8394b4 |
2.21.1
|
|
|
8394b4 |
|