From: Dmitry Stogov Date: Fri, 15 Feb 2013 13:46:38 +0000 (+0400) Subject: Fixed possible resource leak X-Git-Tag: php-5.5.0beta1~42^2~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bee06002d0fee1c440a5c5d04220a587416fdfb4;p=php Fixed possible resource leak --- diff --git a/shared_alloc_win32.c b/shared_alloc_win32.c index 4abf23de8f..32b7c3a845 100644 --- a/shared_alloc_win32.c +++ b/shared_alloc_win32.c @@ -138,6 +138,7 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in) err = GetLastError(); zend_win_error_message(ACCEL_LOG_FATAL, "Unable to read base address", err); *error_in="read mapping base"; + fclose(fp); return ALLOC_FAILURE; } fclose(fp); @@ -280,6 +281,7 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_ if(!fp) { zend_win_error_message(ACCEL_LOG_WARNING, mmap_base_file, err); zend_win_error_message(ACCEL_LOG_FATAL, "Unable to write base address", err); + return ALLOC_FAILURE; } fprintf(fp, "%p\n", mapping_base); fclose(fp);