octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51088] double free at Octave exit


From: Rik
Subject: [Octave-bug-tracker] [bug #51088] double free at Octave exit
Date: Tue, 23 May 2017 19:35:08 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0

Follow-up Comment #3, bug #51088 (project octave):

The changeset works.  However, is the second half of the cset necessary?


diff -r 22fd2ad85218 -r 784c3cb82f8a libinterp/corefcn/symtab.h
--- a/libinterp/corefcn/symtab.h        Thu May 18 08:09:08 2017 -0700
+++ b/libinterp/corefcn/symtab.h        Mon May 22 22:57:56 2017 +0200
@@ -1222,7 +1222,12 @@
 
     if (p != all_instances.end ())
       {
-        delete p->second;
+        // First zero the table entry to avoid possible duplicate delete.
+        symbol_table *inst = p->second;
+        p->second = 0;
+
+        // Now delete the scope.
+        delete inst;
 
         all_instances.erase (p);


I removed this part of the patch and it still continued to work.  Also, it
seems like we shouldn't be zeroing the pointer of the symbol_table since we
want the symbol table destructor to be called if it exists.  Thoughts on
that?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51088>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]