diff options
author | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-09-01 10:09:20 +0200 |
---|---|---|
committer | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-10-29 12:39:42 +0200 |
commit | f4c246b78ed9ac1f33d01eb194fde54dcd6f3df1 (patch) | |
tree | 4dead65c94fabf12eba78679709986b6121eb56d | |
parent | 9e038b65ffc57afb36435e87eceb2ae0c8a8d175 (diff) | |
download | gdm-f4c246b78ed9ac1f33d01eb194fde54dcd6f3df1.tar.gz |
gdm-launch-environment: Add missing guards in public functions
-rw-r--r-- | daemon/gdm-launch-environment.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c index 10ab84b3..507d6de7 100644 --- a/daemon/gdm-launch-environment.c +++ b/daemon/gdm-launch-environment.c @@ -409,6 +409,8 @@ gdm_launch_environment_start (GdmLaunchEnvironment *launch_environment) uid_t uid; gid_t gid; + g_return_val_if_fail (GDM_IS_LAUNCH_ENVIRONMENT (launch_environment), FALSE); + g_debug ("GdmLaunchEnvironment: Starting..."); if (!gdm_get_pwent_for_name (launch_environment->user_name, &passwd_entry)) { @@ -504,6 +506,8 @@ gdm_launch_environment_start (GdmLaunchEnvironment *launch_environment) gboolean gdm_launch_environment_stop (GdmLaunchEnvironment *launch_environment) { + g_return_val_if_fail (GDM_IS_LAUNCH_ENVIRONMENT (launch_environment), FALSE); + if (launch_environment->pid > 1) { gdm_signal_pid (-launch_environment->pid, SIGTERM); } @@ -522,12 +526,16 @@ gdm_launch_environment_stop (GdmLaunchEnvironment *launch_environment) GdmSession * gdm_launch_environment_get_session (GdmLaunchEnvironment *launch_environment) { + g_return_val_if_fail (GDM_IS_LAUNCH_ENVIRONMENT (launch_environment), NULL); + return launch_environment->session; } char * gdm_launch_environment_get_session_id (GdmLaunchEnvironment *launch_environment) { + g_return_val_if_fail (GDM_IS_LAUNCH_ENVIRONMENT (launch_environment), NULL); + return g_strdup (launch_environment->session_id); } |