dtcalc/ds_xlib.c: Coverity CID 175167; uninit value
authorJon Trulson <jon@radscan.com>
Tue, 3 Apr 2018 00:07:54 +0000 (18:07 -0600)
committerJon Trulson <jon@radscan.com>
Tue, 3 Apr 2018 00:07:54 +0000 (18:07 -0600)
cde/programs/dtcalc/ds_xlib.c

index 1136c91bb2810fccf573910fc4fe9243bd8c57f7..7115984a1ae55f1040b00b6dbea45310ba8f23f5 100644 (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;