Blame SOURCES/0060-Ticket-49534-Fix-coverity-regression.patch

96373c
From 3c605035eff49e603c8e4a4c0886499913924529 Mon Sep 17 00:00:00 2001
96373c
From: Mark Reynolds <mreynolds@redhat.com>
96373c
Date: Wed, 24 Jan 2018 14:24:08 -0500
96373c
Subject: [PATCH] Ticket 49534 - Fix coverity regression
96373c
96373c
Description:  In automembers plugin a free was in the wrong spot
96373c
              which later led to a double free for the "rule".
96373c
96373c
https://pagure.io/389-ds-base/issue/49534
96373c
96373c
Reviewed by: mreynolds (one line commit rule)
96373c
96373c
(cherry picked from commit b3768e602fdfc2ea1fc645b17ad61c8592ab87fa)
96373c
---
96373c
 ldap/servers/plugins/automember/automember.c | 2 +-
96373c
 1 file changed, 1 insertion(+), 1 deletion(-)
96373c
96373c
diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c
96373c
index cbd25915a..c91aa4e8e 100644
96373c
--- a/ldap/servers/plugins/automember/automember.c
96373c
+++ b/ldap/servers/plugins/automember/automember.c
96373c
@@ -1117,11 +1117,11 @@ automember_parse_regex_entry(struct configEntry *config, Slapi_Entry *e)
96373c
                             break;
96373c
                         }
96373c
                     }
96373c
+                    automember_free_regex_rule(rule);
96373c
                 } else {
96373c
                     /* Add to head of list */
96373c
                     PR_INSERT_LINK(&(rule->list), (PRCList *)config->exclusive_rules);
96373c
                 }
96373c
-                automember_free_regex_rule(rule);
96373c
             } else {
96373c
                 slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM,
96373c
                               "automember_parse_regex_entry - Skipping invalid exclusive "
96373c
-- 
96373c
2.13.6
96373c