mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
libDtHelp: Cov 88275
This commit is contained in:
parent
5571bbceae
commit
b4c10b4d63
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue