chiark / gitweb /
checkpath.c: Match `xmalloc' with `xfree', not `free'.
[checkpath] / checkpath.c
index 5c047a595ebea34a561cd2359ce8dc4baf87502b..4cf5181ddc1d19ce82cb22151ecf5d857090438e 100644 (file)
@@ -139,7 +139,7 @@ static void pop(void)
     struct elt *e = sp->e_link;
     d.len = sp->e_offset;
     DPUTZ(&d);
-    free(sp); sp = e;
+    xfree(sp); sp = e;
   }
 }
 
@@ -387,7 +387,7 @@ unsigned checkpath(const char *p, const struct checkpath *cp)
     /* --- Strip off simple `.' elements --- */
 
     if (strcmp(ee->e_name, ".") == 0) {
-      free(ee);
+      xfree(ee);
       ee = e;
       continue;
     }
@@ -396,7 +396,7 @@ unsigned checkpath(const char *p, const struct checkpath *cp)
 
     else if (strcmp(ee->e_name, "..") == 0) {
       pop();
-      free(ee);
+      xfree(ee);
       ee = e;
       continue;
     }
@@ -480,7 +480,7 @@ unsigned checkpath(const char *p, const struct checkpath *cp)
       report(cp, CP_ERROR, 0, 0, "junk left over after reaching leaf");
     while (ee) {
       e = ee->e_link;
-      free(ee);
+      xfree(ee);
       ee = e;
     }
   }