aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/input/seat.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 7b0fe67d..dc21ce61 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -905,12 +905,9 @@ static void set_workspace(struct sway_seat *seat,
905 905
906 if (seat->workspace) { 906 if (seat->workspace) {
907 free(seat->prev_workspace_name); 907 free(seat->prev_workspace_name);
908 seat->prev_workspace_name = malloc(strlen(seat->workspace->name) + 1); 908 seat->prev_workspace_name = strdup(seat->workspace->name);
909 if (!seat->prev_workspace_name) { 909 if (!seat->prev_workspace_name) {
910 sway_log(SWAY_ERROR, "Unable to allocate previous workspace name"); 910 sway_log(SWAY_ERROR, "Unable to allocate previous workspace name");
911 seat->prev_workspace_name = NULL;
912 } else {
913 strcpy(seat->prev_workspace_name, seat->workspace->name);
914 } 911 }
915 } 912 }
916 913