File bug-986056_pacemaker-attrd-segfault-on-exit.patch of Package pacemaker.3577
commit 3c62fb1d0deab7a15603c90abeff163aa093802f
Author: Gao,Yan <ygao@suse.com>
Date: Fri Jun 17 11:20:13 2016 +0200
Fix: attrd,ipc: Prevent possible segfault on exit
Index: pacemaker/attrd/main.c
===================================================================
--- pacemaker.orig/attrd/main.c
+++ pacemaker/attrd/main.c
@@ -373,8 +373,8 @@ main(int argc, char **argv)
crm_notice("Cleaning up before exit");
election_fini(writer);
- crm_client_disconnect_all(ipcs);
if (ipcs) {
+ crm_client_disconnect_all(ipcs);
qb_ipcs_destroy(ipcs);
g_hash_table_destroy(attributes);
}
Index: pacemaker/lib/common/ipc.c
===================================================================
--- pacemaker.orig/lib/common/ipc.c
+++ pacemaker/lib/common/ipc.c
@@ -270,7 +270,13 @@ crm_client_cleanup(void)
void
crm_client_disconnect_all(qb_ipcs_service_t *service)
{
- qb_ipcs_connection_t *c = qb_ipcs_connection_first_get(service);
+ qb_ipcs_connection_t *c = NULL;
+
+ if (service == NULL) {
+ return;
+ }
+
+ c = qb_ipcs_connection_first_get(service);
while (c != NULL) {
qb_ipcs_connection_t *last = c;