summaryrefslogtreecommitdiff
path: root/src/win32/posix_w32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/win32/posix_w32.c')
-rw-r--r--src/win32/posix_w32.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index a05aafcca..ed7450a94 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -20,7 +20,7 @@ int p_unlink(const char *path)
buf = gitwin_to_utf16(path);
_wchmod(buf, 0666);
ret = _wunlink(buf);
- free(buf);
+ git__free(buf);
return ret;
}
@@ -86,11 +86,11 @@ static int do_lstat(const char *file_name, struct stat *buf)
buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
- free(fbuf);
+ git__free(fbuf);
return GIT_SUCCESS;
}
- free(fbuf);
+ git__free(fbuf);
switch (GetLastError()) {
case ERROR_ACCESS_DENIED:
@@ -171,7 +171,7 @@ int p_readlink(const char *link, char *target, size_t target_len)
FILE_FLAG_BACKUP_SEMANTICS, // normal file
NULL); // no attr. template
- free(link_w);
+ git__free(link_w);
if (hFile == INVALID_HANDLE_VALUE)
return GIT_EOSERR;
@@ -184,17 +184,17 @@ int p_readlink(const char *link, char *target, size_t target_len)
dwRet = pGetFinalPath(hFile, target_w, target_len, 0x0);
if (dwRet >= target_len) {
- free(target_w);
+ git__free(target_w);
CloseHandle(hFile);
return GIT_ENOMEM;
}
if (!WideCharToMultiByte(CP_UTF8, 0, target_w, -1, target, target_len * sizeof(char), NULL, NULL)) {
- free(target_w);
+ git__free(target_w);
return GIT_EOSERR;
}
- free(target_w);
+ git__free(target_w);
CloseHandle(hFile);
if (dwRet > 4) {
@@ -226,7 +226,7 @@ int p_open(const char *path, int flags)
wchar_t* buf = gitwin_to_utf16(path);
fd = _wopen(buf, flags | _O_BINARY);
- free(buf);
+ git__free(buf);
return fd;
}
@@ -236,7 +236,7 @@ int p_creat(const char *path, int mode)
wchar_t* buf = gitwin_to_utf16(path);
fd = _wopen(buf, _O_WRONLY | _O_CREAT | _O_TRUNC | _O_BINARY, mode);
- free(buf);
+ git__free(buf);
return fd;
}
@@ -246,11 +246,11 @@ int p_getcwd(char *buffer_out, size_t size)
_wgetcwd(buf, (int)size);
if (!WideCharToMultiByte(CP_UTF8, 0, buf, -1, buffer_out, size, NULL, NULL)) {
- free(buf);
+ git__free(buf);
return GIT_EOSERR;
}
- free(buf);
+ git__free(buf);
return GIT_SUCCESS;
}
@@ -264,7 +264,7 @@ int p_chdir(const char* path)
wchar_t* buf = gitwin_to_utf16(path);
int ret = _wchdir(buf);
- free(buf);
+ git__free(buf);
return ret;
}
@@ -273,7 +273,7 @@ int p_chmod(const char* path, int mode)
wchar_t* buf = gitwin_to_utf16(path);
int ret = _wchmod(buf, mode);
- free(buf);
+ git__free(buf);
return ret;
}
@@ -282,7 +282,7 @@ int p_rmdir(const char* path)
wchar_t* buf = gitwin_to_utf16(path);
int ret = _wrmdir(buf);
- free(buf);
+ git__free(buf);
return ret;
}
@@ -294,7 +294,7 @@ int p_hide_directory__w32(const char *path)
error = SetFileAttributesW(buf, FILE_ATTRIBUTE_HIDDEN) != 0 ?
GIT_SUCCESS : GIT_ERROR; /* MSDN states a "non zero" value indicates a success */
- free(buf);
+ git__free(buf);
if (error < GIT_SUCCESS)
error = git__throw(GIT_EOSERR, "Failed to hide directory '%s'", path);
@@ -314,21 +314,21 @@ char *p_realpath(const char *orig_path, char *buffer)
}
ret = GetFullPathNameW(orig_path_w, GIT_PATH_MAX, buffer_w, NULL);
- free(orig_path_w);
+ git__free(orig_path_w);
if (!ret || ret > GIT_PATH_MAX) {
- free(buffer_w);
- if (alloc) free(buffer);
+ git__free(buffer_w);
+ if (alloc) git__free(buffer);
return NULL;
}
if (!WideCharToMultiByte(CP_UTF8, 0, buffer_w, -1, buffer, GIT_PATH_MAX, NULL, NULL)) {
- free(buffer_w);
- if (alloc) free(buffer);
+ git__free(buffer_w);
+ if (alloc) git__free(buffer);
}
- free(buffer_w);
+ git__free(buffer_w);
git_path_mkposix(buffer);
return buffer;
}
@@ -384,7 +384,7 @@ int p_access(const char* path, int mode)
int ret;
ret = _waccess(buf, mode);
- free(buf);
+ git__free(buf);
return ret;
}