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:
5571bbc
)
libDtHelp: Cov 88275
author
Peter Howkins
<flibble@users.sf.net>
Sat, 11 Aug 2018 00:08:17 +0000
(
01:08
+0100)
committer
Peter Howkins
<flibble@users.sf.net>
Sat, 11 Aug 2018 00:08:17 +0000
(
01:08
+0100)
cde/lib/DtHelp/Environ_c.c
patch
|
blob
|
history
diff --git
a/cde/lib/DtHelp/Environ_c.c
b/cde/lib/DtHelp/Environ_c.c
index 516278db7306759a6a907f80ca54f7ea458bfd9b..3e7990238353fb2fbacb877c1d372e9cb41be1b6 100644
(file)
--- a/
cde/lib/DtHelp/Environ_c.c
+++ b/
cde/lib/DtHelp/Environ_c.c
@@
-74,6
+74,7
@@
char * _DtCliSrvGetDtUserSession(void)
char screen[BUFSIZ];
char * display = NULL;
char * localDisplayVar = getenv("DISPLAY");
+ int needsfree = 0;
if (localDisplayVar == NULL) {
@@
-98,6
+99,7
@@
char * _DtCliSrvGetDtUserSession(void)
}
else {
display = malloc(strlen(localDisplayVar) + 1);
+ needsfree = 1;
strcpy(display, localDisplayVar);
}
@@
-120,6
+122,10
@@
char * _DtCliSrvGetDtUserSession(void)
if (envVar)
sprintf (envVar, "%s-%s-%s", logname, display, screen);
+ if(needsfree) {
+ free(display);
+ }
+
return envVar;
}
}