]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_compile.c
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / sbr / fmt_compile.c
index 3930f8ca8563cc9904fe8a72a77461193a3d8dad..aa555c623fd050dce66ed0ed07861bafca77b5e0 100644 (file)
@@ -280,11 +280,12 @@ static struct colormap colortable[] = {
 /*
  * Find a component in the hash table.
  */
-#define FINDCOMP(comp,name) \
-               for (comp = wantcomp[CHASH(name)]; \
-                    comp && strcmp(comp->c_name,name); \
-                    comp = comp->c_next) \
-               ;
+#define FINDCOMP(comp,name) do { \
+        for (comp = wantcomp[CHASH(name)]; \
+            comp && strcmp(comp->c_name,name); \
+            comp = comp->c_next) \
+        ; \
+    } while (0)
 
 /* Add new component to the hash table */
 #define NEWCOMP(cm,name) do { \
@@ -968,7 +969,7 @@ fmt_freecomptext(void)
 
     for (i = 0; i < DIM(wantcomp); i++)
         for (cm = wantcomp[i]; cm; cm = cm->c_next) {
-            mh_xfree(cm->c_text);
+            free(cm->c_text);
             cm->c_text = NULL;
         }
 }
@@ -1142,8 +1143,8 @@ free_component(struct comp *cm)
 {
     if (--cm->c_refcount <= 0) {
        /* Shouldn't ever be NULL, but just in case ... */
-        mh_xfree(cm->c_name);
-        mh_xfree(cm->c_text);
+        free(cm->c_name);
+        free(cm->c_text);
        if (cm->c_type & CT_DATE)
            free(cm->c_tws);
        if (cm->c_type & CT_ADDR && cm->c_mn && cm->c_mn != &fmt_mnull)