aboutsummaryrefslogtreecommitdiff
path: root/gdb/completer.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2008-11-24 17:05:43 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2008-11-24 17:05:43 +0000
commita0b7aece708587e6c4a33d9c62fd0fe73b990b6b (patch)
tree2444e61df22afca27ae6618b923afff1919e7d8c /gdb/completer.c
parentd962ef8246f50ac5726c6b82881074ccab47f822 (diff)
downloadgdb-a0b7aece708587e6c4a33d9c62fd0fe73b990b6b.zip
gdb-a0b7aece708587e6c4a33d9c62fd0fe73b990b6b.tar.gz
gdb-a0b7aece708587e6c4a33d9c62fd0fe73b990b6b.tar.bz2
Fix access of an already freed memory.
* parse.c (parse_field_expression): Call xstrdup on `*name'. * completer.c (expression_completer): Free fieldname.
Diffstat (limited to 'gdb/completer.c')
-rw-r--r--gdb/completer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/completer.c b/gdb/completer.c
index e7ee817..d109140 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -414,9 +414,11 @@ expression_completer (char *text, char *word)
add_struct_fields (type, &out, result, fieldname, flen);
result[out] = NULL;
+ xfree (fieldname);
return result;
}
}
+ xfree (fieldname);
/* Commands which complete on locations want to see the entire
argument. */