- /* generate a unique pathname for the log file using hostname */
- log_pathname = malloc(PATH_MAX+10);
+ /* allocate buffer big enough for next sprintf() call */
+ log_pathname = malloc( 10 +
+ strlen((char * )pdu->name) +
+ strlen(client->hostname));