diff options
author | Michael Snyder <msnyder@vmware.com> | 2011-02-27 00:59:07 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2011-02-27 00:59:07 +0000 |
commit | 66fd3b1e63d5273421e2df25bc760deb499799af (patch) | |
tree | 25fef2ca44cb60b28dbde9e85c74a1789937fa09 | |
parent | 8c814cdde7fd000c640b4158b6492038b3e4d6dc (diff) | |
download | gdb-66fd3b1e63d5273421e2df25bc760deb499799af.zip gdb-66fd3b1e63d5273421e2df25bc760deb499799af.tar.gz gdb-66fd3b1e63d5273421e2df25bc760deb499799af.tar.bz2 |
2011-02-26 Michael Snyder <msnyder@vmware.com>
* maint.c (maintenance_do_deprecate): Plug a memory leak.
-rw-r--r-- | gdb/ChangeLog | 2 | ||||
-rw-r--r-- | gdb/maint.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 38ac01c..95e92d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-02-26 Michael Snyder <msnyder@vmware.com> + * 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 60245f6..101c2de 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. */ |