projects
/
oweals
/
cde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
caa95ba
)
dtfile/sharedFuncs: CID 88085; resource leak
author
Jon Trulson
<jon@radscan.com>
Thu, 5 Apr 2018 19:28:04 +0000
(13:28 -0600)
committer
Jon Trulson
<jon@radscan.com>
Thu, 5 Apr 2018 19:28:04 +0000
(13:28 -0600)
cde/programs/dtfile/dtcopy/sharedFuncs.c
patch
|
blob
|
history
diff --git
a/cde/programs/dtfile/dtcopy/sharedFuncs.c
b/cde/programs/dtfile/dtcopy/sharedFuncs.c
index efeca3bbf03897845f21679a34448d299b495fc6..3d5b0c4af2e52e8373d572b246fd34d17d8259fb 100644
(file)
--- a/
cde/programs/dtfile/dtcopy/sharedFuncs.c
+++ b/
cde/programs/dtfile/dtcopy/sharedFuncs.c
@@
-481,9
+481,11
@@
CopyCheckDeletePermission(
#endif
{
char *tmpfile;
- tmpfile = tempnam(parentdir,"quang");
- if (creat(tmpfile,O_RDONLY)< 0) /* Create a temporary file */
+ int rv;
+ tmpfile = tempnam(parentdir,"dtfile");
+ if ( (rv = creat(tmpfile,O_RDONLY)) < 0) /* Create a temporary file */
return -1;
+ close(rv);
if (remove(tmpfile) < 0) /* Delete the created file */
return -1;
}