summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2012-08-08 13:54:53 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-08 15:32:05 +0100
commitac88b01fc014f28484aa8520a962c24ea4fdc80a (patch)
treefcc9378fc3064ccc30cd9fb595c3ac2b455435b9
parent30e2d785d7ff2e042c315c2e1cd703c77e727c29 (diff)
downloadnode-startup-controller-ac88b01fc014f28484aa8520a962c24ea4fdc80a.tar.gz
Fix segmentation faults and remove an unused variable
Fix a segmentation fault in target_startup_monitor_finalize caused by freeing the data of a list item instead of the actual unit list we want to free. Fix another possible segmentation fault in la_handler_service_handle_consumer_lifecycle_request_finish caused by logging a message using the wrong GError. Remove an unused variable in la_handler_service_handle_register.
-rw-r--r--NEWS2
-rw-r--r--node-startup-controller/la-handler-service.c3
-rw-r--r--node-startup-controller/target-startup-monitor.c4
3 files changed, 6 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 199ef8f..cb94f51 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ x.y.z
* Simplify g_variant_lookup_value_with_int_key() to avoid license
issues (the previously implementation was based on code from
GLib)
+* Fix segmentation fault in TargetStartupMonitor.
+* Fix segmentation fault in LAHandlerService.
* Add documentation for the GLib extension functions.
* Add documentation for the JobManager class
* Add documentation for the LAHandlerService class
diff --git a/node-startup-controller/la-handler-service.c b/node-startup-controller/la-handler-service.c
index d968c80..7dc9b49 100644
--- a/node-startup-controller/la-handler-service.c
+++ b/node-startup-controller/la-handler-service.c
@@ -351,7 +351,6 @@ la_handler_service_handle_register (LAHandler *interface,
* re-register its client with the new shutdown mode and timeout */
/* extract information from the client */
- consumer = shutdown_client_get_consumer (client);
existing_bus_name = shutdown_client_get_bus_name (client);
existing_object_path = shutdown_client_get_object_path (client);
@@ -560,7 +559,7 @@ la_handler_service_handle_consumer_lifecycle_request_finish (JobManager *manage
DLT_LOG (la_handler_context, DLT_LOG_ERROR,
DLT_STRING ("Failed to notify NSM about completed lifecycle request:"),
DLT_STRING ("request id"), DLT_UINT (data->request_id),
- DLT_STRING ("error message"), DLT_STRING (error->message));
+ DLT_STRING ("error message"), DLT_STRING (err->message));
g_error_free (err);
}
else if (error_status == NSM_ERROR_STATUS_OK)
diff --git a/node-startup-controller/target-startup-monitor.c b/node-startup-controller/target-startup-monitor.c
index 4a425cf..33cf463 100644
--- a/node-startup-controller/target-startup-monitor.c
+++ b/node-startup-controller/target-startup-monitor.c
@@ -215,7 +215,9 @@ target_startup_monitor_finalize (GObject *object)
0, 0, NULL, NULL, monitor);
g_object_unref (lp->data);
}
- g_list_free (lp->data);
+
+ /* release the list of systemd units */
+ g_list_free (monitor->units);
/* release the mapping of systemd targets to node states */
g_hash_table_destroy (monitor->targets_to_states);