- Timestamp:
- 05/05/11 00:00:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/regfi-threadtest.c
r228 r250 44 44 #include "common.c" 45 45 46 46 static bool keysEqual(const REGFI_NK* x, const REGFI_NK* y) 47 { 48 return (x != NULL && y != NULL && x->offset == y->offset); 49 } 47 50 48 51 void traverseValueList(REGFI_ITERATOR* iter) … … 57 60 value = regfi_iterator_cur_value(iter); 58 61 printMsgs(iter->f); 59 regfi_free_record( value);62 regfi_free_record(iter->f, value); 60 63 } 61 64 } … … 70 73 bool print_this = true; 71 74 72 root = cur = regfi_iterator_cur_key(iter); 75 root = regfi_iterator_cur_key(iter); 76 regfi_reference_record(iter->f, root); 77 cur = root; 73 78 regfi_iterator_first_subkey(iter); 74 79 sub = regfi_iterator_cur_subkey(iter); … … 85 90 if(sub == NULL) 86 91 { 87 if( cur != root)92 if(!keysEqual(cur,root)) 88 93 { 89 94 /* We're done with this sub-tree, going up and hitting other branches. */ 90 regfi_free_record(cur); 95 regfi_free_record(iter->f, cur); 96 cur = NULL; 91 97 if(!regfi_iterator_up(iter)) 92 98 { … … 102 108 sk = regfi_fetch_sk(iter->f, cur); 103 109 printMsgs(iter->f); 104 regfi_free_record( sk);110 regfi_free_record(iter->f, sk); 105 111 106 112 regfi_iterator_next_subkey(iter); … … 113 119 * Let's move down and print this first sub-tree out. 114 120 */ 115 regfi_free_record(cur); 121 regfi_free_record(iter->f, cur); 122 cur = NULL; 116 123 if(!regfi_iterator_down(iter)) 117 124 { … … 122 129 cur = regfi_iterator_cur_key(iter); 123 130 printMsgs(iter->f); 124 regfi_free_record( sub);131 regfi_free_record(iter->f, sub); 125 132 126 133 regfi_iterator_first_subkey(iter); … … 130 137 } 131 138 printMsgs(iter->f); 132 } while(!((cur == root) && (sub == NULL))); 133 regfi_free_record(root); 139 } while(!(keysEqual(cur,root) && (sub == NULL))); 140 if(cur != NULL) 141 regfi_free_record(iter->f, cur); 142 regfi_free_record(iter->f, root); 134 143 135 144 if(print_verbose)
Note: See TracChangeset
for help on using the changeset viewer.