Browse Source

Fixed memory leak when using loadnpc or reloadnpcfile command (#5667)

Fixes #5649
CairoLee 4 years ago
parent
commit
01188b1501
2 changed files with 2 additions and 1 deletions
  1. 1 1
      src/map/atcommand.cpp
  2. 1 0
      src/map/npc.cpp

+ 1 - 1
src/map/atcommand.cpp

@@ -4752,7 +4752,7 @@ ACMD_FUNC(loadnpc)
 
 
 	npc_read_event_script();
 	npc_read_event_script();
 
 
-	ShowStatus( "NPC file '" CL_WHITE "%s" CL_RESET "' was reloaded.\n", message );
+	ShowStatus( "NPC file '" CL_WHITE "%s" CL_RESET "' was loaded.\n", message );
 	npc_event_doall_path( script_config.init_event_name, message );
 	npc_event_doall_path( script_config.init_event_name, message );
 
 
 	clif_displaymessage(fd, msg_txt(sd,262)); // Script loaded.
 	clif_displaymessage(fd, msg_txt(sd,262)); // Script loaded.

+ 1 - 0
src/map/npc.cpp

@@ -581,6 +581,7 @@ int npc_event_doall_path( const char* event_name, const char* path ){
 
 
 	ShowStatus( "Event '" CL_WHITE "%s" CL_RESET "' executed with '" CL_WHITE "%d" CL_RESET "' NPCs.\n", event_name, count );
 	ShowStatus( "Event '" CL_WHITE "%s" CL_RESET "' executed with '" CL_WHITE "%d" CL_RESET "' NPCs.\n", event_name, count );
 
 
+	mapit_free(iter);
 	return count;
 	return count;
 }
 }