* syscalls.cc (pathconf): Fix memory leak.

This commit is contained in:
Corinna Vinschen 2009-03-27 11:29:56 +00:00
parent d6e045e614
commit 7a9f309bcd
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2009-03-27 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (pathconf): Fix memory leak.
2009-03-26 Corinna Vinschen <corinna@vinschen.de> 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_worker): Write target filename as UTF-16 string * path.cc (symlink_worker): Write target filename as UTF-16 string

View File

@ -2047,10 +2047,12 @@ extern "C" long int
pathconf (const char *file, int v) pathconf (const char *file, int v)
{ {
fhandler_base *fh; fhandler_base *fh;
long ret = -1;
myfault efault; myfault efault;
if (efault.faulted (EFAULT)) if (efault.faulted (EFAULT))
return -1; return -1;
if (!*file) if (!*file)
{ {
set_errno (ENOENT); set_errno (ENOENT);
@ -2059,11 +2061,11 @@ pathconf (const char *file, int v)
if (!(fh = build_fh_name (file, NULL, PC_SYM_FOLLOW, stat_suffixes))) if (!(fh = build_fh_name (file, NULL, PC_SYM_FOLLOW, stat_suffixes)))
return -1; return -1;
if (!fh->exists ()) if (!fh->exists ())
{ set_errno (ENOENT);
set_errno (ENOENT); else
return -1; ret = fh->fpathconf (v);
} delete fh;
return fh->fpathconf (v); return ret;
} }
extern "C" int extern "C" int