aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-11-08 20:22:29 -0700
committerTom Tromey <tom@tromey.com>2016-11-12 10:34:46 -0700
commitd93f4d96bb0fb307db9e2dade38ddb3c6bc469ca (patch)
tree406f33f8619ea14abbfed0450ece76fd1e236cae /gdb/rust-lang.c
parent6cb2202baaf482a8c7d54e5ec93af2f057e7ce28 (diff)
downloadgdb-d93f4d96bb0fb307db9e2dade38ddb3c6bc469ca.zip
gdb-d93f4d96bb0fb307db9e2dade38ddb3c6bc469ca.tar.gz
gdb-d93f4d96bb0fb307db9e2dade38ddb3c6bc469ca.tar.bz2
Use std::string in rust_get_disr_info
This changes rust_get_disr_info to use std::string in one more spot, avoiding a memory leak. 2016-11-12 Tom Tromey <tom@tromey.com> * rust-lang.c (rust_get_disr_info): Use std::string in one more spot.
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r--gdb/rust-lang.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 295dae1..7d4bfc3 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -222,7 +222,7 @@ rust_get_disr_info (struct type *type, const gdb_byte *valaddr,
with the first field being the actual type works. */
const char *field_name = TYPE_NAME (TYPE_FIELD_TYPE (type, 0));
const char *last = rust_last_path_segment (field_name);
- ret.name = concat (TYPE_NAME (type), "::", last, (char *) NULL);
+ ret.name = std::string (TYPE_NAME (type)) + "::" + last;
ret.field_no = RUST_ENCODED_ENUM_REAL;
ret.is_encoded = 1;
return ret;