Replace do_restore_instream_cleanup with scoped_restore
[deliverable/binutils-gdb.git] / gdb / gdb_regex.c
index 2e376e3869598dca3fd8132c1226fe4175503df9..55c398077b7c6276585dcbfb33365f720d7bd324 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "defs.h"
 #include "gdb_regex.h"
+#include "common/def-vector.h"
 
 compiled_regex::compiled_regex (const char *regex, int cflags,
                                const char *message)
@@ -28,10 +29,10 @@ compiled_regex::compiled_regex (const char *regex, int cflags,
   if (code != 0)
     {
       size_t length = regerror (code, &m_pattern, NULL, 0);
-      std::unique_ptr<char[]> err (new char[length]);
+      gdb::def_vector<char> err (length);
 
-      regerror (code, &m_pattern, err.get (), length);
-      error (("%s: %s"), message, err.get ());
+      regerror (code, &m_pattern, err.data (), length);
+      error (("%s: %s"), message, err.data ());
     }
 }
 
This page took 0.02443 seconds and 4 git commands to generate.