zic.c:mkdirs broken

Bradley White bww+ at transarc.com
Wed Feb 9 19:43:32 UTC 1994


+	/* We must make a copy in case the
+	   passed pointer is a read-only string.  */
+	char *name = ecpyalloc (argname);
 
+	if ((cp = name) == NULL || *cp == '\0') {
+	  free (name);
+	  return 0;
+	}

ecpyalloc(x) [a.k.a. memcheck(icpyalloc(x))] cannot return 0.

But, if you just want to program defensively, it is also good
practice not to pass 0 to free(), despite what any standards
might say.  With the ialloc package you can achieve this via
ifree().

Bradley



More information about the tz mailing list