Index: filed.c ================================================================== --- filed.c +++ filed.c @@ -827,11 +827,15 @@ /* Open socket as ANSI I/O for ease of use */ fp = fdopen(fd, "w+b"); if (fp == NULL) { close(fd); - free(log); + log->buffer[0] = '\0'; + log->http_code = -1; + log->reason = "fdopen_failed"; + + filed_log_entry(log); return; } request = filed_get_http_request(fp, request, options);