Ignore:
Timestamp:
Aug 18, 2009, 3:25:29 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3342@localhost: bruno | 2009-08-14 00:46:51 +0200

  • Another round of strcpy suppressions
  • find_home_of_exe() now allocates memory which has to be freed by the caller
  • Supress useless sz_last_suffix()
  • mr_getline now has the same interface as the other mr_mem functions
  • valgrind and compiler warnings fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-cli.c

    r2330 r2331  
    709709    }
    710710
    711     if (!find_home_of_exe("afio")) {
    712         if (find_home_of_exe("star")) {
     711    tmp1 = find_home_of_exe("afio");
     712    if (!tmp1) {
     713        mr_free(tmp1);
     714        tmp1 = find_home_of_exe("star");
     715        if (tmp1) {
     716            mr_free(tmp1);
    713717            flag_set['R'] = TRUE;
    714718            log_msg(1, "Using star instead of afio");
    715719        } else {
    716             fatal_error
    717                 ("Neither afio nor star is installed. Please install at least one.");
    718         }
    719     }
     720            mr_free(tmp1);
     721            fatal_error("Neither afio nor star is installed. Please install at least one.");
     722        }
     723    }
     724    mr_free(tmp1);
    720725
    721726    if (flag_set['R']) {
     
    724729            fatal_error("You may not use star and lzop at the same time.");
    725730        }
    726         if (!find_home_of_exe("star")) {
    727             fatal_error
    728                 ("Please install 'star' RPM or tarball if you are going to use -R. Thanks.");
    729         }
     731        tmp1 = find_home_of_exe("star");
     732        if (!tmp1) {
     733            mr_free(tmp1);
     734            fatal_error("Please install 'star' RPM or tarball if you are going to use -R. Thanks.");
     735        }
     736        mr_free(tmp1);
    730737    }
    731738
     
    919926        }
    920927        if (! bkpinfo->restore_data) {
    921             if (!find_home_of_exe("growisofs")) {
     928            tmp1 = find_home_of_exe("growisofs");
     929            if (!tmp1) {
     930                mr_free(tmp1);
    922931                fatal_error("Please install growisofs (probably part of dvd+rw-tools). If you want DVD support, you need it.");
    923932            }
    924             if (!find_home_of_exe("dvd+rw-format")) {
     933            mr_free(tmp1);
     934
     935            tmp1 = find_home_of_exe("dvd+rw-format");
     936            if (!tmp1) {
     937                mr_free(tmp1);
    925938                fatal_error("Please install dvd+rw-format (probably part of dvd+rw-tools). If you want DVD support, you need it.");
    926939            }
     940            mr_free(tmp1);
     941
    927942            if (!flag_set['s']) {
    928943                sprintf(flag_val['s'], "%d", DEFAULT_DVD_DISK_SIZE);    // 4.7 salesman's GB = 4.482 real GB = 4582 MB
     
    10461061    }
    10471062    if (flag_set['z']) {
    1048         if (find_home_of_exe("getfattr")) {
     1063        tmp1 = find_home_of_exe("getfattr");
     1064        if (tmp1) {
    10491065            mr_asprintf(g_getfattr,"getfattr");
    10501066        }
    1051         if (find_home_of_exe("getfacl")) {
     1067        mr_free(tmp1);
     1068
     1069        tmp1 = find_home_of_exe("getfacl");
     1070        if (tmp1) {
    10521071            mr_asprintf(g_getfacl,"getfacl");
    10531072        }
     1073        mr_free(tmp1);
    10541074    }
    10551075
     
    13321352
    13331353    if (flag_set['Q']) {
    1334         i = which_boot_loader(tmp1);
    1335         log_msg(3, "boot loader is %c, residing at %s", i, tmp1);
    1336         printf("boot loader is %c, residing at %s\n", i, tmp1);
    1337         mr_free(tmp1);
     1354        i = which_boot_loader(NULL);
     1355        log_msg(3, "boot loader is %c", i);
     1356        printf("boot loader is %c\n", i);
    13381357        finish(0);
    13391358    }
Note: See TracChangeset for help on using the changeset viewer.