aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-02-27 00:59:07 +0000
committerMichael Snyder <msnyder@vmware.com>2011-02-27 00:59:07 +0000
commit66fd3b1e63d5273421e2df25bc760deb499799af (patch)
tree25fef2ca44cb60b28dbde9e85c74a1789937fa09
parent8c814cdde7fd000c640b4158b6492038b3e4d6dc (diff)
downloadgdb-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/ChangeLog2
-rw-r--r--gdb/maint.c3
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. */