andykimpe / rpms / 389-ds-base

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

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

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