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:
adb0acb
)
dtexec,DtSvc/MsgLog.c: coverity CID 89585; resource leak
author
Jon Trulson
<jon@radscan.com>
Sun, 1 Apr 2018 19:54:22 +0000
(13:54 -0600)
committer
Jon Trulson
<jon@radscan.com>
Sun, 1 Apr 2018 19:54:22 +0000
(13:54 -0600)
cde/lib/DtSvc/DtUtil2/MsgLog.c
patch
|
blob
|
history
diff --git
a/cde/lib/DtSvc/DtUtil2/MsgLog.c
b/cde/lib/DtSvc/DtUtil2/MsgLog.c
index 0aa48d1d5ec43928bb63e93d1015d5bf27aa612e..8997b74566aa5f6beb7947e5e6ba0900adfe9aa7 100644
(file)
--- a/
cde/lib/DtSvc/DtUtil2/MsgLog.c
+++ b/
cde/lib/DtSvc/DtUtil2/MsgLog.c
@@
-141,7
+141,7
@@
static char * get_file_name (
const char * format,
... )
{
- char *file
, *rtn
;
+ char *file;
va_list args;
file = malloc(MAXPATHLEN+1);
@@
-153,11
+153,12
@@
static char * get_file_name (
va_end (args);
if ((*fp = fopen (file, type)) == NULL)
- return (NULL);
-
- rtn = strdup (file);
- free(file);
- return rtn;
+ {
+ free(file);
+ return (NULL);
+ }
+
+ return file;
}