dtcalc/ds_xlib.c: Coverity CID 175167; uninit value

This commit is contained in:
Jon Trulson 2018-04-02 18:07:54 -06:00
parent d5c304d476
commit 45bccb474c
1 changed files with 3 additions and 1 deletions

View File

@ -263,8 +263,10 @@ ds_save_resources(XrmDatabase rDB, char *filename)
{
if ((filename = getenv("DTCALCDEF")) == NULL)
{
if ( !(home = getenv("HOME")) )
return 1;
size_t fileLen = strlen(home) + 18;
home = getenv("HOME");
if ( (filename = calloc(1, fileLen)) != NULL )
{
needsFree = true;