]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
opts-common.c (generate_canonical_option): Free opt_text it it has been allocated...
authorJakub Jelinek <jakub@redhat.com>
Fri, 11 Nov 2011 08:15:56 +0000 (09:15 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 11 Nov 2011 08:15:56 +0000 (09:15 +0100)
* opts-common.c (generate_canonical_option): Free opt_text
it it has been allocated here and not stored anywhere.

From-SVN: r181282

gcc/ChangeLog
gcc/opts-common.c

index 94c9370ce3974b6be05dfda0021445660232f558..5f194707b2c74aec079c8ebb2185fc2118193e14 100644 (file)
@@ -1,5 +1,8 @@
 2011-11-11  Jakub Jelinek  <jakub@redhat.com>
 
+       * opts-common.c (generate_canonical_option): Free opt_text
+       it it has been allocated here and not stored anywhere.
+
        * tree-vect-slp.c (vect_free_slp_tree): Also free SLP_TREE_CHILDREN
        vector.
        (vect_create_new_slp_node): Don't allocate node before checking stmt
index 00edbe6601c1da94d57198e969f7231e6d932804..354bce07dc2c155893a3c76efa5077d5974931e0 100644 (file)
@@ -304,6 +304,8 @@ generate_canonical_option (size_t opt_index, const char *arg, int value,
          decoded->canonical_option[0] = concat (opt_text, arg, NULL);
          decoded->canonical_option[1] = NULL;
          decoded->canonical_option_num_elements = 1;
+         if (opt_text != option->opt_text)
+           free (CONST_CAST (char *, opt_text));
        }
     }
   else