libDtHelp: Fix another regression caused by Coverity fix, clicking 'Help Manager...
[oweals/cde.git] / cde / programs / dtfile / Help.c
index 774cad57e3cdf3ca39c1aacc340b23ec773c0791..ad3e95c073e85747b07d109f3c5d14a6dd001aec 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  * Floor, Boston, MA 02110-1301 USA
  */
@@ -498,22 +498,21 @@ MapFileTypeToHelpString(
       return(buf);
    }
 
-#ifdef old
-   if (miscData)
-      /* The DtGetActionDescription function must be modified to
-         accept a non-integral second parameter.  (Filetypes are no
-         longer expressed as integers. */
-      desc = DtGetActionDescription(filetype, -1);
-   else
-#endif
-      desc = DtDtsDataTypeToAttributeValue(filetype,
-                                           DtDTS_DA_DESCRIPTION,
-                                           NULL);
+   desc = DtDtsDataTypeToAttributeValue(filetype,
+                                        DtDTS_DA_DESCRIPTION,
+                                        NULL);
 
    isAction = DtDtsDataTypeIsAction(filetype);
 
    if (desc)
-      return(XtNewString(desc));
+   {
+      char *descptr = XtNewString(desc);
+      XtFree((char *)desc);
+      if (descptr)
+         return descptr;
+      else
+         return NULL;
+   }
 
    /* No description found for this filetype */
    if (isAction)