amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone

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

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