Author: mir3x
Date: Mon Jan 16 14:03:22 2017
New Revision: 34850

URL: http://svn.gna.org/viewcvs/freeciv?rev=34850&view=rev
Log:
Qt client - fixed mismatched free/delete

See bug #25431


Modified:
    branches/S2_6/client/gui-qt/themes.cpp

Modified: branches/S2_6/client/gui-qt/themes.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/themes.cpp?rev=34850&r1=34849&r2=34850&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/themes.cpp      (original)
+++ branches/S2_6/client/gui-qt/themes.cpp      Mon Jan 16 14:03:22 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
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to