=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/session.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- src/usr.bin/tmux/session.c 2015/10/28 09:51:55 1.57 +++ src/usr.bin/tmux/session.c 2015/10/31 08:13:58 1.58 @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.57 2015/10/28 09:51:55 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.58 2015/10/31 08:13:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -104,8 +104,8 @@ /* Create a new session. */ struct session * session_create(const char *name, int argc, char **argv, const char *path, - int cwd, struct environ *env, struct termios *tio, int idx, u_int sx, - u_int sy, char **cause) + const char *cwd, struct environ *env, struct termios *tio, int idx, + u_int sx, u_int sy, char **cause) { struct session *s; struct winlink *wl; @@ -114,7 +114,7 @@ s->references = 1; s->flags = 0; - s->cwd = dup(cwd); + s->cwd = xstrdup(cwd); s->curw = NULL; TAILQ_INIT(&s->lastw); @@ -224,7 +224,7 @@ winlink_remove(&s->windows, wl); } - close(s->cwd); + free((void *)s->cwd); session_unref(s); } @@ -315,7 +315,7 @@ /* Create a new window on a session. */ struct winlink * session_new(struct session *s, const char *name, int argc, char **argv, - const char *path, int cwd, int idx, char **cause) + const char *path, const char *cwd, int idx, char **cause) { struct window *w; struct winlink *wl;