Hi,

It seems I found a memory leak in tmux. In status_job (status.c), cmd is
allocated and is not released if the command line is parsed without
error.

If someone uses a low value for status-interval (i.e less than 5
seconds) and a long command line for status jobs, memory consumption may
increase quickly.

Patch is in attachment.

Thanks,

Greg

-- 
Gregory Thiemonge
--- tmux/status.c	2010-01-28 23:46:44.000000000 +0100
+++ tmux.gt/status.c	2010-03-02 10:05:18.000000000 +0100
@@ -527,6 +527,9 @@
 		    JOB_PERSIST, c, cmd, status_job_callback, xfree, NULL);
 		job_run(job);
 	}
+
+	xfree(cmd);
+
 	if (job->data == NULL)
 		return (xstrdup(""));
 	return (xstrdup(job->data));
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to