Changeset 2260 in MondoRescue
- Timestamp:
- Jul 12, 2009, 2:04:21 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-raid.c
r2241 r2260 192 192 { 193 193 /*@ buffers ***************************************************** */ 194 char *sz_value; 195 196 malloc_string(sz_value); 194 char *sz_value = NULL; 195 197 196 assert(raidrec != NULL); 198 197 assert(label != NULL); 199 198 200 sprintf(sz_value, "%d", value);199 mr_asprintf(&sz_value, "%d", value); 201 200 strcpy(raidrec->additional_vars.el[lino].label, label); 202 201 strcpy(raidrec->additional_vars.el[lino].value, sz_value); 203 paranoid_free(sz_value);202 mr_free(sz_value); 204 203 } 205 204 #endif … … 472 471 { 473 472 FILE *fin; 474 char *tmp ;473 char *tmp1 = NULL; 475 474 int items; 476 475 477 malloc_string(tmp);478 476 raidlist->spares.entries = 0; 479 477 raidlist->disks.entries = 0; … … 481 479 log_it("Raidtab is very small or non-existent. Ignoring it."); 482 480 raidlist->entries = 0; 483 paranoid_free(tmp);484 481 return (0); 485 482 } 486 483 if (!(fin = fopen(fname, "r"))) { 487 484 log_it("Cannot open raidtab"); 488 paranoid_free(tmp);489 485 return (1); 490 486 } … … 589 585 fclose(fin); 590 586 log_it("Raidtab loaded successfully."); 591 sprintf(tmp, "%d RAID devices in raidtab", raidlist->entries);592 log_it(tmp );593 paranoid_free(tmp);587 mr_asprintf(&tmp1, "%d RAID devices in raidtab", raidlist->entries); 588 log_it(tmp1); 589 mr_free(tmp1); 594 590 return (0); 595 591 } … … 691 687 692 688 /*@ add mallocs * */ 693 char *tmp ;689 char *tmp = NULL; 694 690 char *labelB; 695 691 char *valueB; … … 699 695 int v; 700 696 701 malloc_string(tmp);702 697 malloc_string(labelB); 703 698 malloc_string(valueB); … … 749 744 } 750 745 if (!disklist) { 751 sprintf(tmp, 752 "Ignoring '%s %s' pair of disk %s", labelB, valueB, 753 label); 746 mr_asprintf(&tmp, "Ignoring '%s %s' pair of disk %s", labelB, valueB, label); 754 747 log_it(tmp); 748 mr_free(tmp); 755 749 } else { 756 750 index = atoi(valueB); … … 763 757 raidrec->additional_vars.entries = ++v; 764 758 } 765 paranoid_free(tmp);766 759 paranoid_free(labelB); 767 760 paranoid_free(valueB);
Note:
See TracChangeset
for help on using the changeset viewer.