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

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