Changeset 689 in MondoRescue for trunk/mondo/mondo/mondorestore


Ignore:
Timestamp:
Jul 17, 2006, 7:43:58 PM (18 years ago)
Author:
bcornec
Message:

Still other memory management improvements ( I hope :-)

Location:
trunk/mondo/mondo/mondorestore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondorestore/mondo-prep.c

    r688 r689  
    203203    iamhere("STARTING");
    204204    log_msg(1, "OK, opened i-want-my-lvm. Shutting down LVM volumes...");
    205     if (find_home_of_exe("lvm"))    // found it :) cool
     205    tmp = find_home_of_exe("lvm");
     206    if (tmp)    // found it :) cool
    206207    {
    207208        asprintf(&lvscan_sz, "lvm lvscan");
     
    219220        asprintf(&vgremove_sz, "vgremove");
    220221    }
     222    paranoid_free(tmp);
     223
    221224    asprintf(&command,
    222225            "for i in `%s | cut -d\"'\" -f2 | sort -r` ; do echo \"Shutting down lv $i\" >> "
  • trunk/mondo/mondo/mondorestore/mondo-restore.c

    r688 r689  
    20492049        asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    20502050        asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2051         if (length_of_file(acl_fname) > 0 && find_home_of_exe("setfacl")) {
     2051        tmp = find_home_of_exe("setfacl");
     2052        if (length_of_file(acl_fname) > 0 && tmp) {
    20522053            set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    20532054        }
    2054         if (length_of_file(xattr_fname) > 0
    2055             && find_home_of_exe("setfattr")) {
     2055        paranoid_free(tmp);
     2056
     2057        tmp = find_home_of_exe("setfattr");
     2058        if (length_of_file(xattr_fname) > 0 && tmp) {
    20562059            set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
    20572060        }
     2061        paranoid_free(tmp);
    20582062        paranoid_free(acl_fname);
    20592063        paranoid_free(xattr_fname);
     
    25662570    log_msg(1, "path is now %s", newpath);
    25672571    log_msg(1, "restoring everything");
    2568     if (!find_home_of_exe("petris") && !g_text_mode) {
     2572    tmp = find_home_of_exe("petris");
     2573    if (!tmp && !g_text_mode) {
    25692574        newtDrawRootText(0, g_noof_rows - 2,
    25702575                         _
     
    25722577        newtRefresh();
    25732578    }
     2579    paranoid_free(tmp);
     2580
    25742581    mvaddstr_and_log_it(g_currentY, 0,
    25752582                        _("Preparing to read your archives"));
  • trunk/mondo/mondo/mondorestore/mondo-rstr-compare.c

    r688 r689  
    6868        return (1);
    6969    }
     70    paranoid_free(tmp1);
     71
    7072    fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin);
    7173    paranoid_fclose(fin);
     
    251253
    252254    if (compressor_exe != NULL) {
    253         if (!find_home_of_exe(compressor_exe)) {
     255        tmp = find_home_of_exe(compressor_exe);
     256        if (!tmp) {
    254257            fatal_error("(compare_a_tarball) Compression program missing");
    255258        }
     259        paranoid_free(tmp);
    256260        if (use_star) {
    257261            if (strcmp(compressor_exe, "bzip2")) {
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r688 r689  
    659659        asprintf(&p1, "-o ro");
    660660    }
    661     if (find_home_of_exe("setfattr")) {
     661    tmp = find_home_of_exe("setfattr");
     662    if (tmp) {
    662663        asprintf(&p2, ",user_xattr");
    663664    } else {
    664665        asprintf(&p2, "");
    665666    }
    666     if (find_home_of_exe("setfacl")) {
     667    paranoid_free(tmp);
     668
     669    tmp = find_home_of_exe("setfacl");
     670    if (tmp) {
    667671        asprintf(&p3, ",acl");
    668672    } else {
    669673        asprintf(&p3, "");
    670674    }
     675    paranoid_free(tmp);
     676
    671677    asprintf(&additional_parameters, "%s%s%s", p1, p2, p3);
    672678    paranoid_free(p1);
     
    13741380{
    13751381    char *output = NULL;
     1382    char *tmp = NULL;
    13761383
    13771384    /* BERLIOS: This should use $EDITOR + conf file rather first */
    1378     if (find_home_of_exe("pico")) {
     1385    tmp = find_home_of_exe("pico");
     1386    if (tmp) {
    13791387        asprintf(&output, "pico");
    1380     } else if (find_home_of_exe("nano")) {
    1381         asprintf(&output, "nano");
    1382     } else if (find_home_of_exe("e3em")) {
    1383         asprintf(&output, "e3em");
    1384     } else if (find_home_of_exe("e3vi")) {
    1385         asprintf(&output, "e3vi");
    1386     } else {
    1387         asprintf(&output, "vi");
    1388     }
    1389     if (!find_home_of_exe(output)) {
     1388    } else {
     1389        tmp = find_home_of_exe("nano");
     1390        if (tmp) {
     1391            asprintf(&output, "nano");
     1392        } else {
     1393            tmp = find_home_of_exe("vi");
     1394            if (tmp) {
     1395                asprintf(&output, "vi");
     1396            } else {
     1397                asprintf(&output, "emacs");
     1398            }
     1399        }
     1400    }
     1401    paranoid_free(tmp);
     1402
     1403    tmp = find_home_of_exe(output);
     1404    if (!tmp) {
    13901405        log_msg(2, " (find_my_editor) --- warning - %s not found", output);
    13911406    }
     1407    paranoid_free(tmp);
    13921408    return (output);
    13931409}
Note: See TracChangeset for help on using the changeset viewer.