From: Jakub Jelinek Date: Fri, 11 Nov 2011 08:15:56 +0000 (+0100) Subject: opts-common.c (generate_canonical_option): Free opt_text it it has been allocated... X-Git-Tag: releases/gcc-4.7.0~2251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca3e7c9ffdf8d0478f51c49e68c5f13eb90fe8c4;p=thirdparty%2Fgcc.git opts-common.c (generate_canonical_option): Free opt_text it it has been allocated here and not stored anywhere. * opts-common.c (generate_canonical_option): Free opt_text it it has been allocated here and not stored anywhere. From-SVN: r181282 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 94c9370ce397..5f194707b2c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2011-11-11 Jakub Jelinek + * 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 diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 00edbe6601c1..354bce07dc2c 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -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