Fix configure errors when using GTK 2 and ASAN

Memory leaks in the test programs run by configure when using GTK 2
result in configuration failures when using -fsanitize=address in
{CXX,LD}FLAGS, so fix these leaks to allow configuring using
"CXXFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address" together with
--with-gtk=2 (this already worked correctly with the default GTK 3).

Closes https://github.com/wxWidgets/wxWidgets/pull/2001
This commit is contained in:
Teodor Petrov 2020-07-27 01:06:01 +03:00 committed by Vadim Zeitlin
parent c924ecb10a
commit 90082b002d
3 changed files with 10 additions and 0 deletions

View File

@ -80,8 +80,10 @@ main ()
tmp_version = g_strdup("$min_gtk_version"); tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) { if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version"); printf("%s, bad version string\n", "$min_gtk_version");
g_free(tmp_version);
exit(1); exit(1);
} }
g_free(tmp_version);
if ((gtk_major_version != $gtk_config_major_version) || if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) || (gtk_minor_version != $gtk_config_minor_version) ||

View File

@ -78,9 +78,11 @@ main ()
/* HP/UX 9 (%@#!) writes to sscanf strings */ /* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version"); tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) { if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
g_free(tmp_version);
printf("%s, bad version string\n", "$min_gtk_version"); printf("%s, bad version string\n", "$min_gtk_version");
exit(1); exit(1);
} }
g_free(tmp_version);
if ((gtk_major_version != $gtk_config_major_version) || if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) || (gtk_minor_version != $gtk_config_minor_version) ||

6
configure vendored
View File

@ -23471,8 +23471,10 @@ main ()
tmp_version = g_strdup("$min_gtk_version"); tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) { if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version"); printf("%s, bad version string\n", "$min_gtk_version");
g_free(tmp_version);
exit(1); exit(1);
} }
g_free(tmp_version);
if ((gtk_major_version != $gtk_config_major_version) || if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) || (gtk_minor_version != $gtk_config_minor_version) ||
@ -23997,9 +23999,11 @@ main ()
/* HP/UX 9 (%@#!) writes to sscanf strings */ /* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version"); tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) { if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
g_free(tmp_version);
printf("%s, bad version string\n", "$min_gtk_version"); printf("%s, bad version string\n", "$min_gtk_version");
exit(1); exit(1);
} }
g_free(tmp_version);
if ((gtk_major_version != $gtk_config_major_version) || if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) || (gtk_minor_version != $gtk_config_minor_version) ||
@ -24269,9 +24273,11 @@ main ()
/* HP/UX 9 (%@#!) writes to sscanf strings */ /* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version"); tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) { if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
g_free(tmp_version);
printf("%s, bad version string\n", "$min_gtk_version"); printf("%s, bad version string\n", "$min_gtk_version");
exit(1); exit(1);
} }
g_free(tmp_version);
if ((gtk_major_version != $gtk_config_major_version) || if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) || (gtk_minor_version != $gtk_config_minor_version) ||