dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtmail / dtmail / AlternatesListUiItem.C
index 3745f769991b421bc727c549189d47dc62f70bf0..6828c2836adbfdc1c5c679937b02595d385766b7 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
  */
@@ -179,8 +179,10 @@ void AlternatesListUiItem::writeFromSourceToUi()
        list_str = strdup("");
   }
   
-  if ((buf = (char *) malloc(strlen(list_str) + 1)) == NULL)
+  if ((buf = (char *) malloc(strlen(list_str) + 1)) == NULL) {
+    free((void *) list_str);
     return;
+  }
   strcpy(buf, (char *)list_str);
   
   if((token = (char *) strtok(buf, " "))) 
@@ -210,8 +212,7 @@ void AlternatesListUiItem::writeFromSourceToUi()
 
   delete char_list;
 
-  if(list_str != NULL)
-    free((void *)list_str);
+  free((void *)list_str);
 
   if(buf != NULL)
     free((void *)buf);