From 1f10f6ea8b7208efa3689ca1e0073a791777cb40 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 24 Oct 2007 11:42:03 +0000 Subject: Close memory leaks. --- tmux.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tmux.c') diff --git a/tmux.c b/tmux.c index d5a3a0fd..1a8a5227 100644 --- a/tmux.c +++ b/tmux.c @@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.37 2007-10-24 11:21:29 nicm Exp $ */ +/* $Id: tmux.c,v 1.38 2007-10-24 11:42:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -238,7 +238,12 @@ main(int argc, char **argv) client_write_server2(&cctx, MSG_COMMAND, &data, sizeof data, BUFFER_OUT(b), BUFFER_USED(b)); buffer_destroy(b); - + + if (path != NULL) + xfree(path); + if (name != NULL) + xfree(name); + for (;;) { pfd.fd = cctx.srv_fd; pfd.events = POLLIN; @@ -290,6 +295,12 @@ main(int argc, char **argv) } out: + xfree(default_command); + + close(cctx.srv_fd); + buffer_destroy(cctx.srv_in); + buffer_destroy(cctx.srv_out); + #ifdef DEBUG xmalloc_report(getpid(), "client"); #endif -- cgit