dtfile/Help.c: coverity CID 88484; use after free
authorJon Trulson <jon@radscan.com>
Sun, 1 Apr 2018 00:11:14 +0000 (18:11 -0600)
committerJon Trulson <jon@radscan.com>
Sun, 1 Apr 2018 00:11:14 +0000 (18:11 -0600)
cde/programs/dtfile/Help.c

index 16ec31d6765a4bd8d1d241ba099ab4366759ae4d..774cad57e3cdf3ca39c1aacc340b23ec773c0791 100644 (file)
@@ -473,7 +473,7 @@ MapFileTypeToHelpString(
    char * desc;
    Boolean isAction;
    char * tmpStr;
-   char * label;
+   char * label = NULL;
 
    /* Special case for the 2 built in directory commands */
    if (strcmp(filetype, openNewView) == 0)
@@ -536,6 +536,7 @@ MapFileTypeToHelpString(
        buf = XtMalloc(strlen(label) + strlen(helpPattern) + 100);
        sprintf(buf, helpPattern, label);
        DtDtsFreeAttributeValue(label);
+       label = NULL;
    }
    else
    {