basename(3) creates a static buffer for storing paths. This libcall can fail if malloc fails however, and this potential failure isn't documented in the manage: 68 char * 69 basename(const char *path) 70 { 71 static char *bname = NULL; 72 73 if (bname == NULL) { 74 bname = (char *)malloc(MAXPATHLEN); 75 if (bname == NULL) 76 return (NULL); 77 }
Note that basename(3) was reimplemented in FreeBSD 12, and correctly doesn't have any errors defined, so this only applies to 11.2/11-STABLE at the moment.
MARKED AS SPAM
OBE per comment 1.