Memory leak patch-I

Uttam Pawar uttamp@us.ibm.com
Sat Feb 18 00:44:00 GMT 2006


Hi,

The following patch fixes some more memory leaks. I did not file any PRs
to track these leaks (so these are not reported). Let me know if I need
to open one.

Bootstrapped and regtested on powerpc64-linux. No new regressions.

Thanks,

Uttam


Patch
======================================================================

2006-02-17  Uttam Pawar  <uttamp@us.ibm.com>

        * gensupport.c (identify_predicable_attribute): Free
        p_false pointer.
        * gcov.c (create_file_names): Free name pointer.
        * bt-load.c (augment_live_range): Free tos pointer.

Index: gcc/gensupport.c
===================================================================
*** gcc/gensupport.c    (revision 111144)
--- gcc/gensupport.c    (working copy)
*************** identify_predicable_attribute (void)
*** 464,469 ****
--- 464,471 ----
        message_with_line (elem->lineno,
                         "attribute `predicable' is not a boolean");
        errors = 1;
+       if (p_false)
+         free (p_false);
        return;
      }
    p_true[-1] = '\0';
*************** identify_predicable_attribute (void)
*** 481,492 ****
--- 483,498 ----
        message_with_line (elem->lineno,
                         "attribute `predicable' cannot be const");
        errors = 1;
+       if (p_false)
+         free (p_false);
        return;

      default:
        message_with_line (elem->lineno,
                         "attribute `predicable' must have a constant default");
        errors = 1;
+       if (p_false)
+         free (p_false);
        return;
      }

*************** identify_predicable_attribute (void)
*** 501,506 ****
--- 507,515 ----
                         value);
        errors = 1;
      }
+
+   if (p_false)
+     free (p_false);
  }

  /* Return the number of alternatives in constraint S.  */
Index: gcc/gcov.c
===================================================================
*** gcc/gcov.c  (revision 111144)
--- gcc/gcov.c  (working copy)
*************** create_file_names (const char *file_name
*** 658,663 ****
--- 658,664 ----
    strcpy (da_file_name, name);
    strcpy (da_file_name + length, GCOV_DATA_SUFFIX);

+   free (name);
    return;
  }

Index: gcc/bt-load.c
===================================================================
*** gcc/bt-load.c       (revision 111144)
--- gcc/bt-load.c       (working copy)
*************** augment_live_range (bitmap live_range, H
*** 911,916 ****
--- 911,917 ----
        {
          if (full_range)
            IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[new_bb->index]);
+         free (tos);
          return;
        }
        *tos++ = new_bb;



More information about the Gcc-patches mailing list