potential memory leak with HashPtrTable
Since the insert()
method is directly inherited from the underlying HashTable, there is no special treatment for any failure. Eg,
T* ptr = new ...;
table.insert(existingKey, ptr);
Since the insert failed, the ptr becomes unmanaged.