dthelp: Further coverity fixes
[oweals/cde.git] / cde / programs / dthelp / dthelpprint / PrintTopics.c
index 3fe4917c3a567939d22d6b9ccffa944c71d4ef88..c5a609951de13f28e511d7d604818c100466bf36 100644 (file)
@@ -2273,13 +2273,11 @@ int ProcessTopics(
    /* if processing subtopics, start processing at the top */
    if ( processSubTopics )
    {
-      char * name = NULL;
       int    offset;
 
       /* get the top topic of the volume */
       ret = _DtHelpCeGetTopTopicId(state->volHandle, &state->currentLocId);
       if (ret != True) state->currentLocId = strdup("_HOMETOPIC");
-      if(name) free(name);
    }
    else
    {   /* otherwise, process only where needed */
@@ -2413,7 +2411,7 @@ int DoHelpTopicsProcessing(
    char *      buf;
    char *      start;
    char *      next;
-   char *      pgbrkFile;
+   char *      pgbrkFile = NULL;
    char *      partFiles[NUMPARTS];
    Boolean     validFile = False;
 
@@ -2514,7 +2512,10 @@ cleanup:
         unlink(partFiles[i]); 
         free(partFiles[i]);
      }
-   unlink(pgbrkFile);
+
+   if(pgbrkFile) { 
+     unlink(pgbrkFile);
+   }
 
    /* NOTE: should free Toc here if interested in no leaks */