Check-in [f8df53b1e3]
Overview
Comment:Fixed potential (but unlikely) memory leaks related to logging
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f8df53b1e3083eff983456a8dc20f8e883572d9b
User & Date: rkeene on 2014-02-18 05:18:57
Other Links: manifest | tags
Context
2014-02-18
05:21
Updated to log fdopen failures instead of silently ignoring them check-in: df2de34e2e user: rkeene tags: trunk
05:18
Fixed potential (but unlikely) memory leaks related to logging check-in: f8df53b1e3 user: rkeene tags: trunk
05:16
More logging optimizations check-in: 937df4b0c8 user: rkeene tags: trunk
Changes

Modified filed.c from [865feafa0e] to [386b3803b7].

   825    825   	date_current = filed_format_time(date_current_b, sizeof(date_current_b), time(NULL));
   826    826   
   827    827   	/* Open socket as ANSI I/O for ease of use */
   828    828   	fp = fdopen(fd, "w+b");
   829    829   	if (fp == NULL) {
   830    830   		close(fd);
   831    831   
          832  +		free(log);
          833  +
   832    834   		return;
   833    835   	}
   834    836   
   835    837   	request = filed_get_http_request(fp, request, options);
   836    838   
   837    839   	if (request == NULL) {
   838    840   		filed_error_page(fp, date_current, 500, FILED_REQUEST_METHOD_GET);
................................................................................
  1046   1048   		 * accept() failing
  1047   1049   		 */
  1048   1050   		if (fd < 0) {
  1049   1051   			/* Log the new connection */
  1050   1052   			filed_log_msg("ACCEPT_FAILED");
  1051   1053   
  1052   1054   			failure_count++;
         1055  +
         1056  +			free(log);
  1053   1057   
  1054   1058   			continue;
  1055   1059   		}
  1056   1060   
  1057   1061   		/* Fill in log structure */
  1058   1062   		if (filed_log_ip((struct sockaddr *) &addr, log->ip, sizeof(log->ip)) == NULL) {
  1059   1063   			log->ip[0] = '\0';