Blame SOURCES/pacemaker-coverity-fixes.patch

1f016a
diff --git a/crmd/control.c b/crmd/control.c
1f016a
index 8989859..0332f10 100644
1f016a
--- a/crmd/control.c
1f016a
+++ b/crmd/control.c
1f016a
@@ -951,7 +951,6 @@ config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
1f016a
         value = crmd_pref(config_hash, "stonith-watchdog-timeout");
1f016a
     }
1f016a
 
1f016a
-    value = crmd_pref(config_hash, "stonith-watchdog-timeout");
1f016a
     if(crm_get_msec(value) > 0 && !daemon_option_enabled(crm_system_name, "watchdog")) {
1f016a
         do_crm_log_always(LOG_EMERG, "Shutting down pacemaker, no watchdog device configured");
1f016a
         crmd_exit(DAEMON_RESPAWN_STOP);
1f016a
diff --git a/crmd/lrm.c b/crmd/lrm.c
1f016a
index 44634fb..b68f657 100644
1f016a
--- a/crmd/lrm.c
1f016a
+++ b/crmd/lrm.c
1f016a
@@ -1377,7 +1377,6 @@ do_lrm_invoke(long long action,
1f016a
     } else if (safe_str_eq(operation, CRM_OP_REPROBE) || safe_str_eq(crm_op, CRM_OP_REPROBE)) {
1f016a
         GHashTableIter gIter;
1f016a
         rsc_history_t *entry = NULL;
1f016a
-        gboolean unregister = is_remote_lrmd_ra(NULL, NULL, entry->id) ? FALSE : TRUE;
1f016a
 
1f016a
         crm_notice("Forcing the status of all resources to be redetected");
1f016a
 
1f016a
@@ -1386,6 +1385,8 @@ do_lrm_invoke(long long action,
1f016a
             /* only unregister the resource during a reprobe if it is not a remote connection
1f016a
              * resource. otherwise unregistering the connection will terminate remote-node
1f016a
              * membership */
1f016a
+            gboolean unregister = is_remote_lrmd_ra(NULL, NULL, entry->id) ? FALSE : TRUE;
1f016a
+
1f016a
             delete_resource(lrm_state, entry->id, &entry->rsc, &gIter, from_sys, from_host,
1f016a
                             user_name, NULL, unregister);
1f016a
         }
1f016a
diff --git a/lib/services/dbus.c b/lib/services/dbus.c
1f016a
index f4632f2..c0153b5 100644
1f016a
--- a/lib/services/dbus.c
1f016a
+++ b/lib/services/dbus.c
1f016a
@@ -338,6 +338,11 @@ pcmk_dbus_get_property(
1f016a
     CRM_LOG_ASSERT(dbus_message_append_args(msg, DBUS_TYPE_STRING, &iface, DBUS_TYPE_INVALID));
1f016a
 
1f016a
     query_data = malloc(sizeof(struct db_getall_data));
1f016a
+    if(query_data == NULL) {
1f016a
+        crm_err("Call to %s failed: malloc failed", method);
1f016a
+        return NULL;
1f016a
+    }
1f016a
+
1f016a
     query_data->target = strdup(target);
1f016a
     query_data->object = strdup(obj);
1f016a
     query_data->callback = callback;
1f016a
@@ -355,10 +360,6 @@ pcmk_dbus_get_property(
1f016a
         DBusMessage *reply = pcmk_dbus_send_recv(msg, connection, NULL);
1f016a
 
1f016a
         output = pcmk_dbus_lookup_result(reply, query_data);
1f016a
-        free(query_data->target);
1f016a
-        free(query_data->object);
1f016a
-        free(query_data->name);
1f016a
-        free(query_data);
1f016a
 
1f016a
         if(reply) {
1f016a
             dbus_message_unref(reply);
1f016a
diff --git a/lib/services/services.c b/lib/services/services.c
1f016a
index 753e257..9936c72 100644
1f016a
--- a/lib/services/services.c
1f016a
+++ b/lib/services/services.c
1f016a
@@ -506,12 +506,13 @@ services_action_sync(svc_action_t * op)
1f016a
 {
1f016a
     gboolean rc = TRUE;
1f016a
 
1f016a
-    op->synchronous = true;
1f016a
     if (op == NULL) {
1f016a
         crm_trace("No operation to execute");
1f016a
         return FALSE;
1f016a
+    }
1f016a
 
1f016a
-    } else if (op->standard && strcasecmp(op->standard, "upstart") == 0) {
1f016a
+    op->synchronous = true;
1f016a
+    if (op->standard && strcasecmp(op->standard, "upstart") == 0) {
1f016a
 #if SUPPORT_UPSTART
1f016a
         rc = upstart_job_exec(op, TRUE);
1f016a
 #endif