From a388dc3736be1d26dffc8badd109620d4ede63ee Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Apr 2011 14:49:16 +0300 Subject: Fix compilation warning. --- src/utils/mkdir.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/utils/mkdir.cpp') diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp index 18d526d47..f0cc65f53 100644 --- a/src/utils/mkdir.cpp +++ b/src/utils/mkdir.cpp @@ -41,7 +41,7 @@ int mkdir_r(const char *pathname) { size_t len = static_cast(strlen(pathname)); - char tmp[len+2]; + char *tmp = new char[len + 2]; char *p; strcpy(tmp, pathname); @@ -79,7 +79,10 @@ int mkdir_r(const char *pathname) continue; } else + { + delete tmp; return -1; + } } #if defined WIN32 @@ -94,6 +97,7 @@ int mkdir_r(const char *pathname) if (!(strlen(tmp) == 2 && !strcmp(tmp + 1, ":"))) #endif + delete tmp; return -1; } @@ -103,6 +107,7 @@ int mkdir_r(const char *pathname) *p = '/'; } } + delete tmp; return 0; } -- cgit v1.2.3-70-g09d2