[Ttssh2-commit] [8461] ツールチップ内のメモリリークを修正

scmno****@osdn***** scmno****@osdn*****
2020年 1月 10日 (金) 22:13:05 JST


Revision: 8461
          https://osdn.net/projects/ttssh2/scm/svn/commits/8461
Author:   zmatsuo
Date:     2020-01-10 22:13:04 +0900 (Fri, 10 Jan 2020)
Log Message:
-----------
ツールチップ内のメモリリークを修正

- 表示文字を変更するとメモリリークしていた

Modified Paths:
--------------
    trunk/teraterm/common/tipwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/tipwin.cpp
===================================================================
--- trunk/teraterm/common/tipwin.cpp	2020-01-10 13:12:51 UTC (rev 8460)
+++ trunk/teraterm/common/tipwin.cpp	2020-01-10 13:13:04 UTC (rev 8461)
@@ -27,7 +27,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 /*
- * Copyright (C) 2008-2019 TeraTerm Project
+ * Copyright (C) 2008-2020 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -304,6 +304,9 @@
 
 	TipWin* self = tWin;
 	self->str_len = wcslen(str);
+	if (self->str != NULL) {
+		free((void *)self->str);
+	}
 	self->str = _wcsdup(str);
 	CalcStrRect();
 


Ttssh2-commit メーリングリストの案内