Changeset 150 for trunk/src/reglookup-recover.c
- Timestamp:
- 03/01/09 21:17:46 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/reglookup-recover.c
r149 r150 15 15 * You should have received a copy of the GNU General Public License 16 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 18 * 19 19 * $Id$ … … 84 84 quoted_name = malloc(1*sizeof(char)); 85 85 if(quoted_name == NULL) 86 bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n"); 86 bailOut(REGLOOKUP_EXIT_OSERR, 87 "ERROR: Could not allocate sufficient memory.\n"); 87 88 quoted_name[0] = '\0'; 88 89 … … 297 298 virt_offset = cur_ancestor->parent_off; 298 299 299 path_element = (struct name_holder*)malloc(sizeof(struct name_holder));300 path_element = talloc(path_stack, struct name_holder); 300 301 if(path_element != NULL) 301 302 path_element->quoted_name = quote_string(cur_ancestor->keyname, … … 305 306 || !void_stack_push(path_stack, path_element)) 306 307 { 307 free(cur_ancestor->keyname);308 free(cur_ancestor);309 void_stack_free _deep(path_stack);308 /* XXX: Need to add a warning here */ 309 regfi_free_key(cur_ancestor); 310 void_stack_free(path_stack); 310 311 return NULL; 311 312 } … … 318 319 ret_val_size += path_element->length + 1; 319 320 320 regfi_ key_free(cur_ancestor);321 regfi_free_key(cur_ancestor); 321 322 } 322 323 } … … 328 329 if(ret_val == NULL) 329 330 { 330 void_stack_free _deep(path_stack);331 void_stack_free(path_stack); 331 332 return NULL; 332 333 } … … 340 341 ret_val_used += path_element->length + 1; 341 342 free(path_element->quoted_name); 342 free(path_element);343 talloc_free(path_element); 343 344 } 344 345 void_stack_free(path_stack); … … 532 533 REGFI_NK_REC* key; 533 534 uint32 i, j; 535 int error_code = 0; 534 536 535 537 for(i=0; i < range_list_size(unalloc_cells); i++) … … 550 552 { 551 553 fprintf(stderr, "ERROR: Couldn't add key to unalloc_keys.\n"); 552 return 20; 554 error_code = 20; 555 goto fail; 553 556 } 557 talloc_steal(unalloc_keys, key); 554 558 j+=key->cell_size-8; 555 559 } … … 561 565 cur_elem = range_list_get(unalloc_keys, i); 562 566 if(!removeRange(unalloc_cells, cur_elem->offset, cur_elem->length)) 563 return 30; 567 { 568 error_code = 30; 569 goto fail; 570 } 564 571 } 565 572 566 573 return 0; 574 575 fail: 576 regfi_free_key(key); 577 return error_code; 567 578 } 568 579 … … 611 622 * so prune it. 612 623 */ 613 free(nk->values->elements); 614 free(nk->values); 624 talloc_free(nk->values); 615 625 nk->values = NULL; 616 626 } … … 639 649 vk->cell_size, vk)) 640 650 { 641 free(vk);651 talloc_free(vk); 642 652 return 30; 643 653 } … … 647 657 } 648 658 else 649 free(vk);659 talloc_free(vk); 650 660 } 651 661 }
Note: See TracChangeset
for help on using the changeset viewer.