Changeset 148 for trunk/lib/regfi.c
- Timestamp:
- 02/22/09 18:22:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfi.c
r147 r148 343 343 { 344 344 ret_val = tmp_val; 345 size += s nprintf(ret_val+size, extra, "%s%s%c%s%c%s%c%s",346 347 348 349 345 size += sprintf(ret_val+size, "%s%s%c%s%c%s%c%s", 346 ace_delim,sid_str, 347 field_delim,type_str, 348 field_delim,perms_str, 349 field_delim,flags_str); 350 350 ace_delim = "|"; 351 351 } … … 1279 1279 { 1280 1280 rla = range_list_add(rb->hbins, hbin->file_off, hbin->block_size, hbin); 1281 if(rla) 1282 talloc_steal(rb->hbins, hbin); 1281 1283 hbin_off = hbin->file_off + hbin->block_size; 1282 1284 hbin = regfi_parse_hbin(rb, hbin_off, true); 1283 1285 } 1284 1285 1286 1286 1287 /* This secret isn't very secret, but we don't need a good one. This … … 1301 1302 1302 1303 1303 /******************************************************************* 1304 ******************************************************************* /1304 /****************************************************************************** 1305 ******************************************************************************/ 1305 1306 int regfi_close(REGFI_FILE *file) 1306 1307 { 1307 1308 int fd; 1308 uint32 i;1309 1309 1310 1310 /* nothing to do if there is no open file */ … … 1314 1314 fd = file->fd; 1315 1315 file->fd = -1; 1316 for(i=0; i < range_list_size(file->hbins); i++) 1317 free(range_list_get(file->hbins, i)->data); 1316 1318 1317 range_list_free(file->hbins); 1319 1318 1320 1321 1319 if(file->sk_cache != NULL) 1322 1320 lru_cache_destroy(file->sk_cache); 1321 1323 1322 free(file); 1324 1325 1323 return close(fd); 1326 1324 } … … 1330 1328 * There should be only *one* root key in the registry file based 1331 1329 * on my experience. --jerry 1332 ***************************************************************************** /1330 ******************************************************************************/ 1333 1331 REGFI_NK_REC* regfi_rootkey(REGFI_FILE *file) 1334 1332 { … … 1791 1789 1792 1790 1793 /******************************************************************* 1791 /****************************************************************************** 1794 1792 * Given real file offset, read and parse the hbin at that location 1795 1793 * along with it's associated cells. 1796 *******************************************************************/ 1797 /* XXX: Need a way to return types of errors. 1798 */ 1794 ******************************************************************************/ 1799 1795 REGFI_HBIN* regfi_parse_hbin(REGFI_FILE* file, uint32 offset, bool strict) 1800 1796 { … … 1825 1821 } 1826 1822 1827 if(!(hbin = (REGFI_HBIN*)zalloc(sizeof(REGFI_HBIN)))) 1823 hbin = talloc(NULL, REGFI_HBIN); 1824 if(hbin == NULL) 1828 1825 return NULL; 1829 1826 hbin->file_off = offset; … … 1836 1833 " 0x%.8X.", hbin->magic[0], hbin->magic[1], 1837 1834 hbin->magic[2], hbin->magic[3], offset); 1838 free(hbin);1835 talloc_free(hbin); 1839 1836 return NULL; 1840 1837 } … … 1858 1855 " or runs off the end of the file" 1859 1856 " while parsing hbin at offset 0x%.8X.", offset); 1860 free(hbin);1857 talloc_free(hbin); 1861 1858 return NULL; 1862 1859 }
Note: See TracChangeset
for help on using the changeset viewer.