removed null checks before delete
Simson L. Garfinkel
5 years ago
85 | 85 |
node(node *p):parent(p),ptr0(0),ptr1(0),tsum(),dirty(false),cached_best(){ }
|
86 | 86 |
int children() const {return (ptr0 ? 1 : 0) + (ptr1 ? 1 : 0);}
|
87 | 87 |
~node(){
|
88 | |
if(ptr0){ delete ptr0; ptr0 = 0; }
|
89 | |
if(ptr1){ delete ptr1; ptr1 = 0; }
|
|
88 |
delete ptr0; ptr0 = 0;
|
|
89 |
delete ptr1; ptr1 = 0;
|
90 | 90 |
};
|
91 | 91 |
// a node is leaf if tsum>0 and both ptrs are 0.
|
92 | 92 |
bool isLeaf() const {
|
|
110 | 110 |
tsum += ptr0->tsum;
|
111 | 111 |
tree.cache_remove(ptr0); // remove it from the cache
|
112 | 112 |
tree.pruned++;
|
113 | |
delete ptr0;
|
114 | |
ptr0=0;
|
|
113 |
delete ptr0; ptr0=0;
|
115 | 114 |
tree.nodes--;
|
116 | 115 |
removed++;
|
117 | 116 |
}
|
78 | 78 |
static uint32_t tcp_timeout;
|
79 | 79 |
static unsigned int get_max_fds(void); // returns the max
|
80 | 80 |
virtual ~tcpdemux(){
|
81 | |
if(xreport) delete xreport;
|
82 | |
if(pwriter) delete pwriter;
|
|
81 |
delete xreport;
|
|
82 |
delete pwriter;
|
83 | 83 |
}
|
84 | 84 |
|
85 | 85 |
/* The pure options class means we can add new options without having to modify the tcpdemux constructor. */
|
102 | 102 |
tcpip::~tcpip()
|
103 | 103 |
{
|
104 | 104 |
assert(fd<0); // file must be closed
|
105 | |
if(seen) delete seen;
|
|
105 |
delete seen; // no need to check to see if seen is null or not.
|
106 | 106 |
}
|
107 | 107 |
|
108 | 108 |
#pragma GCC diagnostic warning "-Weffc++"
|
|
527 | 527 |
fd,out_of_order_count);
|
528 | 528 |
|
529 | 529 |
/* TK: If we have seen packets, everything in the recon set needs to be shifted as well.*/
|
530 | |
if(seen){
|
531 | |
delete seen;
|
532 | |
seen = 0;
|
533 | |
}
|
|
530 |
delete seen;
|
|
531 |
seen = 0;
|
534 | 532 |
}
|
535 | 533 |
|
536 | 534 |
/* if we're not at the correct point in the file, seek there */
|