Reset cfg_ncauses to 0 as well or we could allocate the wrong size if
authornicm <nicm@openbsd.org>
Mon, 27 Apr 2015 22:50:35 +0000 (22:50 +0000)
committernicm <nicm@openbsd.org>
Mon, 27 Apr 2015 22:50:35 +0000 (22:50 +0000)
called again.

usr.bin/tmux/cfg.c

index 1afd2e1..1c8e3a5 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfg.c,v 1.36 2015/04/25 18:49:01 nicm Exp $ */
+/* $OpenBSD: cfg.c,v 1.37 2015/04/27 22:50:35 nicm Exp $ */
 
 /*
  * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -140,6 +140,7 @@ cfg_print_causes(struct cmd_q *cmdq)
 
        free(cfg_causes);
        cfg_causes = NULL;
+       cfg_ncauses = 0;
 }
 
 void
@@ -161,4 +162,5 @@ cfg_show_causes(struct session *s)
 
        free(cfg_causes);
        cfg_causes = NULL;
+       cfg_ncauses = 0;
 }