Revert "gdb/python: Avoid use after free in py-tui.c"
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 5 Jun 2020 20:07:58 +0000 (21:07 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 5 Jun 2020 20:12:55 +0000 (21:12 +0100)
This reverts commit 982a38f60b0ece9385556cff45567e06710478cb.

I missed that the title being assigned too was a std::string, and so
there is no leak.

gdb/ChangeLog
gdb/python/py-tui.c

index 1d486c4b30051713a0dd0a115628a0f1842e74d3..5cd74e6c31b525cb43637848f443dd2132278ab2 100644 (file)
@@ -1,3 +1,8 @@
+2020-06-05  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       Revert commit 982a38f60b0.
+       * python/py-tui.c (gdbpy_tui_set_title): Restore use of get.
+
 2020-06-05  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * python/py-tui.c (gdbpy_tui_set_title): Use release, not get, to
index f2c03395a0bc1632cc9a360c559985c6482f86f0..ca88f85eb9f9af4b38c2ed9276c9d7d9ab38dfc4 100644 (file)
@@ -433,7 +433,7 @@ gdbpy_tui_set_title (PyObject *self, PyObject *newvalue, void *closure)
   if (value == nullptr)
     return -1;
 
-  win->window->title = value.release ();
+  win->window->title = value.get ();
   return 0;
 }