Index: vtc.c
===================================================================
--- vtc.c	(revision 5239)
+++ vtc.c	(working copy)
@@ -657,8 +657,10 @@
 	AZ(mkdir(vtc_tmpdir, 0700));
 	macro_def(vltop, NULL, "tmpdir", vtc_tmpdir);
 
-	cwd = getcwd(NULL, 0);
+	cwd = getcwd(NULL, BUFSIZ);
 	bprintf(topbuild, "%s/%s", cwd, TOP_BUILDDIR);
+	free(cwd);
+	cwd = NULL;
 	macro_def(vltop, NULL, "topbuild", topbuild);
 
 	AZ(pthread_mutex_init(&vtc_mtx, NULL));

