diff options
author | Dhiru Kholia <kholia@kth.se> | 2015-10-27 22:08:59 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-03 07:07:00 -0500 |
commit | b3b4282beb9930b3d1688ff19f8016f35998427d (patch) | |
tree | 0f662e5614cdee85653ab9bef69999c0567e3c25 /m4macros | |
parent | a5b1cdd0c1178cbebc86a116645c2ecac62aaf65 (diff) | |
download | gtk+-b3b4282beb9930b3d1688ff19f8016f35998427d.tar.gz |
Fix a memory leak in gtk-3.0.m4 file
This fix is inspired by,
https://git.gnome.org/browse/glib/tree/m4macros/glib-2.0.m4
https://bugzilla.gnome.org/show_bug.cgi?id=757221
Diffstat (limited to 'm4macros')
-rw-r--r-- | m4macros/gtk-3.0.m4 | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/m4macros/gtk-3.0.m4 b/m4macros/gtk-3.0.m4 index d9b0a2dbdf..4838f16a4d 100644 --- a/m4macros/gtk-3.0.m4 +++ b/m4macros/gtk-3.0.m4 @@ -82,14 +82,11 @@ dnl int main () { - int major, minor, micro; - char *tmp_version; + unsigned int major, minor, micro; fclose (fopen ("conf.gtktest", "w")); - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } @@ -128,9 +125,9 @@ main () } else { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); |