From: Michael Snyder Date: Sun, 27 Feb 2011 00:59:07 +0000 (+0000) Subject: 2011-02-26 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66fd3b1e63d5273421e2df25bc760deb499799af;p=binutils-gdb.git 2011-02-26 Michael Snyder * maint.c (maintenance_do_deprecate): Plug a memory leak. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 38ac01c2fb8..95e92d0c012 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-02-26 Michael Snyder + * maint.c (maintenance_do_deprecate): Plug a memory leak. + * dwarf2loc.c (insert_bits): Avoid shadowing a function param with a local variable of the same name. diff --git a/gdb/maint.c b/gdb/maint.c index 60245f6c4ba..101c2de6178 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -644,6 +644,9 @@ maintenance_do_deprecate (char *text, int deprecate) cmd->flags |= MALLOCED_REPLACEMENT; return; } + /* If we get here, don't leak! */ + if (replacement != NULL) + xfree (replacement); } /* Maintenance set/show framework. */