From 64db75b43e9cebc2035d0b7afc6bde5808f1e54d Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 22 Sep 2004 15:56:02 +0000 Subject: [PATCH] Fix create_dirpath to shut valgrind up. This commit was SVN r2800. --- src/util/os_create_dirpath.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/os_create_dirpath.c b/src/util/os_create_dirpath.c index 4c5aee643f..b6904d163f 100644 --- a/src/util/os_create_dirpath.c +++ b/src/util/os_create_dirpath.c @@ -74,7 +74,9 @@ int ompi_os_create_dirpath(const char *path, const mode_t mode) free(bottom_up); return(OMPI_ERROR); } - strcpy(bottom_up, dirname(bottom_up)); /* "pop" the directory tree */ + tmp = strdup(bottom_up); + strcpy(bottom_up, dirname(tmp)); /* "pop" the directory tree */ + free(tmp); } free(pth);