Commit c1085da6 authored by unknown's avatar unknown
Browse files

ha_innodb.cc:

  Fix a glitch reported by Guilhem: release the memory allocated for innodb_internal_... if innobase_init() fails; cleanups: in ha_innodb, you should use the InnoDB formatting style for the source code


sql/ha_innodb.cc:
  Fix a glitch reported by Guilhem: release the memory allocated for innodb_internal_... if innobase_init() fails; cleanups: in ha_innodb, you should use the InnoDB formatting style for the source code
parent 602d9a03
Loading
Loading
Loading
Loading
+23 −18
Original line number Diff line number Diff line
@@ -1079,6 +1079,8 @@ innobase_init(void)
	if (ret == FALSE) {
	  	sql_print_error(
			"InnoDB: syntax error in innodb_data_file_path");
	  	my_free(internal_innobase_data_file_path,
						MYF(MY_ALLOW_ZERO_PTR));
	  	DBUG_RETURN(TRUE);
	}

@@ -1109,6 +1111,8 @@ innobase_init(void)
		"InnoDB: syntax error in innodb_log_group_home_dir\n"
		"InnoDB: or a wrong number of mirrored log groups\n");

	  	my_free(internal_innobase_data_file_path,
						MYF(MY_ALLOW_ZERO_PTR));
		DBUG_RETURN(TRUE);
	}

@@ -1197,7 +1201,8 @@ innobase_init(void)
	err = innobase_start_or_create_for_mysql();

	if (err != DB_SUCCESS) {

	  	my_free(internal_innobase_data_file_path,
						MYF(MY_ALLOW_ZERO_PTR));
		DBUG_RETURN(1);
	}

@@ -1241,22 +1246,22 @@ innobase_end(void)
		set_panic_flag_for_netware();
	}
#endif
	if (innodb_inited)
	{
	if (innodb_inited) {
	  	if (innobase_very_fast_shutdown) {
	    		srv_very_fast_shutdown = TRUE;
	    		fprintf(stderr,
"InnoDB: MySQL has requested a very fast shutdown without flushing\n"
"InnoDB: the InnoDB buffer pool to data files. At the next mysqld startup\n"
"InnoDB: InnoDB will do a crash recovery!\n");

	  	}

	  	innodb_inited = 0;
	  if (innobase_shutdown_for_mysql() != DB_SUCCESS)
	  	if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
	    		err = 1;
		}
	  	hash_free(&innobase_open_tables);
	  my_free(internal_innobase_data_file_path,MYF(MY_ALLOW_ZERO_PTR));
	  	my_free(internal_innobase_data_file_path,
						MYF(MY_ALLOW_ZERO_PTR));
	  	pthread_mutex_destroy(&innobase_mutex);
	}