mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtfile/sharedFuncs: CID 88085; resource leak
This commit is contained in:
parent
caa95ba67c
commit
70f85d77cc
1 changed files with 4 additions and 2 deletions
|
@ -481,9 +481,11 @@ CopyCheckDeletePermission(
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
char *tmpfile;
|
char *tmpfile;
|
||||||
tmpfile = tempnam(parentdir,"quang");
|
int rv;
|
||||||
if (creat(tmpfile,O_RDONLY)< 0) /* Create a temporary file */
|
tmpfile = tempnam(parentdir,"dtfile");
|
||||||
|
if ( (rv = creat(tmpfile,O_RDONLY)) < 0) /* Create a temporary file */
|
||||||
return -1;
|
return -1;
|
||||||
|
close(rv);
|
||||||
if (remove(tmpfile) < 0) /* Delete the created file */
|
if (remove(tmpfile) < 0) /* Delete the created file */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue