Changeset - r20023:61e99ef9e469
[Not reviewed]
master
0 1 0
rubidium - 11 years ago 2013-02-08 20:31:51
rubidium@openttd.org
(svn r24980) -Fix: memory leak in corner case of handling encoded strings
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -889,11 +889,11 @@ static char *FormatString(char *buff, co
 
						sub_args.SetParam(i++, (uint64)(size_t)g);
 
					}
 
				}
 
				/* We error'd out in the while, to error out in themain too */
 
				if (*str == '\0') break;
 

	
 
				str = p;
 
				buff = GetStringWithArgs(buff, (GAME_TEXT_TAB << TAB_COUNT_OFFSET) + stringid, &sub_args, last, true);
 
				/* If we didn't error out, we can actually print the string. */
 
				if (*str != '\0') {
 
					str = p;
 
					buff = GetStringWithArgs(buff, (GAME_TEXT_TAB << TAB_COUNT_OFFSET) + stringid, &sub_args, last, true);
 
				}
 

	
 
				for (int i = 0; i < 20; i++) {
 
					if (sub_args_need_free[i]) free((void *)sub_args.GetParam(i));
0 comments (0 inline, 0 general)