1
0
Fork 0
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:
Peter Howkins 2018-08-11 01:08:17 +01:00
parent 5571bbceae
commit b4c10b4d63

View file

@ -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;
}
}