Skip to content

Commit 53dcd49

Browse files
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 00ab7f2 commit 53dcd49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/client.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,7 @@ pub const App = struct {
25642564
}
25652565

25662566
pub fn switchToSession(self: *App, target_session: []const u8) !void {
2567+
std.debug.assert(target_session.len > 0);
25672568
// Don't switch if already on the target session
25682569
if (self.current_session_name) |current| {
25692570
if (std.mem.eql(u8, current, target_session)) {
@@ -2578,8 +2579,10 @@ pub const App = struct {
25782579
try self.saveSession(name);
25792580
}
25802581

2582+
// Build arguments for exec
25812583
// Build arguments for exec
25822584
const target_z = try self.allocator.dupeZ(u8, target_session);
2585+
errdefer self.allocator.free(target_z);
25832586
const args = [_]?[*:0]const u8{
25842587
"prise",
25852588
"session",

0 commit comments

Comments
 (0)