Author: mir3x
Date: Mon Jan 16 14:03:42 2017
New Revision: 34852
URL: http://svn.gna.org/viewcvs/freeciv?rev=34852&view=rev
Log:
Qt client - fixed mismatched free/delete
See bug #25431
Modified:
trunk/client/gui-qt/themes.cpp
Modified: trunk/client/gui-qt/themes.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/themes.cpp?rev=34852&r1=34851&r2=34852&view=diff
==============================================================================
--- trunk/client/gui-qt/themes.cpp (original)
+++ trunk/client/gui-qt/themes.cpp Mon Jan 16 14:03:42 2017
@@ -120,7 +120,9 @@
char *persistent = static_cast<char*>(fc_malloc(256));
*count = 1;
- array = new char *[*count];
+ /* array is deleted in C client code and shouln't
+ be allocated with new[] */
+ array = static_cast<char **>(fc_malloc((*count) * sizeof(char *)));
strncpy(persistent, fileinfoname(get_data_dirs(),""), 256);
array[0] = persistent;
return array;
_______________________________________________
Freeciv-commits mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-commits