diff options
author | Chad Brubaker <cbrubaker@google.com> | 2015-03-20 13:54:21 -0700 |
---|---|---|
committer | Chad Brubaker <cbrubaker@google.com> | 2015-03-20 13:59:20 -0700 |
commit | 6f49e5f4e0e9698357417ea8ea26f3b86a2793db (patch) | |
tree | bc9f673144619e37a6994548251b8ffe6e26fafa | |
parent | f862a764e4d20495d484664de852e4d6de26f08b (diff) | |
download | android_system_keymaster-6f49e5f4e0e9698357417ea8ea26f3b86a2793db.tar.gz android_system_keymaster-6f49e5f4e0e9698357417ea8ea26f3b86a2793db.tar.bz2 android_system_keymaster-6f49e5f4e0e9698357417ea8ea26f3b86a2793db.zip |
Remove calls to Entry::~Entry in Delete
The code was using ~Entry to clear the entry for later using a
destructed object is undefined behavior and the object wasn't actually
being zeroed causing the table to fill up and no new operations could be
started.
Change-Id: I236043cc9796e2c6def210b10634de7fa489a8d9
-rw-r--r-- | operation_table.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/operation_table.cpp b/operation_table.cpp index bd110df..14ca2dd 100644 --- a/operation_table.cpp +++ b/operation_table.cpp @@ -76,8 +76,9 @@ bool OperationTable::Delete(keymaster_operation_handle_t op_handle) { for (size_t i = 0; i < table_size_; ++i) { if (table_[i].handle == op_handle) { - // Destructor does the right thing, call it. - table_[i].Entry::~Entry(); + delete table_[i].operation; + table_[i].operation = NULL; + table_[i].handle = 0; return true; } } |