File pacemaker-libcrmcluster-avoid-potential-use-of-NULL.patch of Package pacemaker

commit fce929819f4fd37baac1e72a7c0bb71b3f390e50
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Wed Apr 4 16:06:01 2018 -0500

    Low: libcrmcluster: avoid potential use-of-NULL

Index: pacemaker-1.1.19+20190131.1642a7f84/lib/cluster/election.c
===================================================================
--- pacemaker-1.1.19+20190131.1642a7f84.orig/lib/cluster/election.c
+++ pacemaker-1.1.19+20190131.1642a7f84/lib/cluster/election.c
@@ -136,14 +136,14 @@ election_remove(election_t *e, const cha
 void
 election_reset(election_t *e)
 {
-    crm_trace("Resetting election %s", e->name);
-    if(e) {
+    if (e != NULL) {
+        crm_trace("Resetting election %s", e->name);
         mainloop_timer_stop(e->timeout);
-    }
-    if (e && e->voted) {
-        crm_trace("Destroying voted cache with %d members", g_hash_table_size(e->voted));
-        g_hash_table_destroy(e->voted);
-        e->voted = NULL;
+        if (e->voted) {
+            crm_trace("Destroying voted cache with %d members", g_hash_table_size(e->voted));
+            g_hash_table_destroy(e->voted);
+            e->voted = NULL;
+        }
     }
 }
 
openSUSE Build Service is sponsored by