Ignore:
Timestamp:
Aug 18, 2009, 2:29:11 PM (11 years ago)
Author:
Bruno Cornec
Message:

r3324@localhost: bruno | 2009-07-31 23:42:57 +0200
percent_media_full_comment now allocates memory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-newt.c

    r2300 r2313  
    15881588    malloc_string(sz_parity_disks);
    15891589    malloc_string(sz_failed_disks);
    1590     if (!(bkp_raidrec = malloc(sizeof(struct raid_device_record)))) {
    1591         fatal_error("Cannot malloc space for raidrec");
    1592     }
    1593 
     1590
     1591    bkp_raidrec = mr_malloc(sizeof(struct raid_device_record));
    15941592    log_it("Started edit_raidlist_entry");
    15951593
    1596     memcpy((void *) bkp_raidrec, (void *) raidrec,
    1597            sizeof(struct raid_device_record));
     1594    memcpy((void *) bkp_raidrec, (void *) raidrec, sizeof(struct raid_device_record));
    15981595    sprintf(title_of_editraidForm_window, "%s", raidrec->raid_device);
    15991596    log_msg(2, "Opening newt window");
     
    16371634            choose_raid_level(raidrec);
    16381635        } else if (b_res == bSelectData) {
    1639             select_raid_disks(mountlist, raidlist, raidrec, "data",
    1640                               &raidrec->data_disks);
     1636            select_raid_disks(mountlist, raidlist, raidrec, "data", &raidrec->data_disks);
    16411637        } else if (b_res == bSelectSpare) {
    1642             select_raid_disks(mountlist, raidlist, raidrec, "spare",
    1643                               &raidrec->spare_disks);
     1638            select_raid_disks(mountlist, raidlist, raidrec, "spare", &raidrec->spare_disks);
    16441639        } else if (b_res == bSelectParity) {
    1645             select_raid_disks(mountlist, raidlist, raidrec, "parity",
    1646                               &raidrec->parity_disks);
     1640            select_raid_disks(mountlist, raidlist, raidrec, "parity", &raidrec->parity_disks);
    16471641        } else if (b_res == bSelectFailed) {
    1648             select_raid_disks(mountlist, raidlist, raidrec, "failed",
    1649                               &raidrec->failed_disks);
     1642            select_raid_disks(mountlist, raidlist, raidrec, "failed", &raidrec->failed_disks);
    16501643        } else if (b_res == bAdditional) {
    16511644            edit_raidrec_additional_vars(raidrec);
     
    16571650    }
    16581651    if (b_res == bCancel) {
    1659         memcpy((void *) raidrec, (void *) bkp_raidrec,
    1660                sizeof(struct raid_device_record));
     1652        memcpy((void *) raidrec, (void *) bkp_raidrec, sizeof(struct raid_device_record));
    16611653    }
    16621654    newtPopHelpLine();
    16631655    newtPopWindow();
    1664     mountlist->el[currline].size =
    1665         calculate_raid_device_size(mountlist, raidlist,
    1666                                    raidrec->raid_device);
     1656    mountlist->el[currline].size = calculate_raid_device_size(mountlist, raidlist, raidrec->raid_device);
    16671657    paranoid_free(title_of_editraidForm_window);
    16681658    paranoid_free(sz_raid_level);
     
    18731863
    18741864if (b_res == bCancel) {
    1875     memcpy((void *) raidrec, (void *) &bkp_raidrec,
    1876            sizeof(struct vinum_plex));
     1865    memcpy((void *) raidrec, (void *) &bkp_raidrec, sizeof(struct vinum_plex));
    18771866}
    18781867newtPopWindow();
Note: See TracChangeset for help on using the changeset viewer.