Changeset 689 in MondoRescue for trunk/mondo/mondo/common/libmondo-tools.c


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

Still other memory management improvements ( I hope :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/libmondo-tools.c

    r688 r689  
    348348    char *extra_cdrom_params = NULL;
    349349    char *mondo_mkisofs_sz = NULL;
    350     char *command;
    351     char *hostname, *ip_address;
     350    char *command = NULL;
     351    char *hostname = NULL, *ip_address = NULL;
    352352    int retval = 0;
    353353    long avm = 0;
    354     char *colon;
    355     char *cdr_exe;
    356     char *tmp;
    357     char *tmp1;
     354    char *colon = NULL;
     355    char *cdr_exe = NULL;
     356    char *tmp = NULL;
     357    char *tmp1 = NULL;
    358358    char call_before_iso_user[MAX_STR_LEN] = "\0";
    359359    int rdsiz_MB;
    360     char *iso_path;
     360    char *iso_path = NULL;
    361361
    362362    assert(bkpinfo != NULL);
     
    439439
    440440    if (bkpinfo->backup_media_type == dvd) {
    441         if (!(find_home_of_exe("growisofs"))) {
     441        tmp = find_home_of_exe("growisofs");
     442        if (!tmp) {
    442443            fatal_error("Please install growisofs.");
    443444        }
     445        paranoid_free(tmp);
     446
    444447        if (bkpinfo->nonbootable_backup) {
    445448            asprintf(&mondo_mkisofs_sz, MONDO_GROWISOFS_NONBOOT);
     
    502505            }
    503506        }
    504         if (find_home_of_exe("cdrecord")) {
     507        tmp = find_home_of_exe("cdrecord");
     508        tmp1 = find_home_of_exe("dvdrecord");
     509        if (tmp) {
    505510            asprintf(&cdr_exe, "cdrecord");
    506         } else if (find_home_of_exe("dvdrecord")) {
     511        } else if (tmp1) {
    507512            asprintf(&cdr_exe, "dvdrecord");
    508513        } else {
    509514            fatal_error("Please install either cdrecord or dvdrecord.");
    510515        }
     516        paranoid_free(tmp);
     517        paranoid_free(tmp1);
     518
    511519        if (bkpinfo->nonbootable_backup) {
    512520            asprintf(&mondo_mkisofs_sz, "%s -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_", mrconf->mondo_iso_creation_cmd);
     
    829837
    830838    /*@ buffers ************ */
    831     char *tmp;
     839    char *tmp = NULL;
    832840
    833841    /*@ int's *************** */
     
    913921        /* IA64 always has one vfat partition for EFI even without Windows */
    914922        // retval +=
    915         if (!find_home_of_exe("ms-sys")) {
     923        tmp = find_home_of_exe("ms-sys");
     924        if (!tmp) {
    916925            log_to_screen(_("Please install ms-sys just in case."));
    917926        }
    918 #endif
    919     }
    920 
    921     if (!find_home_of_exe("cmp")) {
    922         if (!find_home_of_exe("true")) {
    923             whine_if_not_found("cmp");
    924         } else {
    925             log_to_screen
    926                 (_("Your system lacks the 'cmp' binary. I'll create a dummy cmp for you."));
    927             if (run_program_and_log_output
    928                 ("cp -f `which true` /usr/bin/cmp", 0)) {
    929                 fatal_error("Failed to create dummy 'cmp' file.");
    930             }
    931         }
    932     }
     927        paranoid_free(tmp);
     928#endif
     929    }
     930
     931    tmp = find_home_of_exe("cmp");
     932    if (!tmp) {
     933        whine_if_not_found("cmp");
     934    }
     935    paranoid_free(tmp);
     936
    933937    run_program_and_log_output
    934938        ("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5);
Note: See TracChangeset for help on using the changeset viewer.