Ignore:
Timestamp:
Jan 28, 2007, 7:04:41 PM (12 years ago)
Author:
bruno
Message:
  • Fix mindi install messages (reported by Andree Leidenfrost)
  • remove paranoid_free/free for mr_free
  • mr_asprintf used everywhere
  • mr_malloc used everywhere
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r1077 r1080  
    11/***************************************************************************
    2 $Id$
    3 restores mondoarchive data
     2* restores mondoarchive data
     3* $Id$
    44***************************************************************************/
    55
     
    2020#include "mondo-rstr-compare-EXT.h"
    2121#include "mondo-rstr-tools-EXT.h"
     22#include "mr_mem.h"
    2223
    2324extern void twenty_seconds_til_yikes(void);
     
    313314        retval += compare_mode(bkpinfo, mountlist, raidlist);
    314315    }
    315     paranoid_free(tmp);
     316    mr_free(tmp);
    316317    return (retval);
    317318}
     
    631632    }
    632633  end_of_func:
    633     paranoid_free(tmp);
    634     paranoid_free(fstab_fname);
    635     paranoid_free(old_restpath);
     634    mr_free(tmp);
     635    mr_free(fstab_fname);
     636    mr_free(old_restpath);
    636637    iamhere("Leaving interactive_mode()");
    637638    return (retval);
     
    912913    assert(bkpinfo != NULL);
    913914    malloc_string(old_restpath);
    914     mountlist = malloc(sizeof(struct mountlist_itself));
    915     raidlist = malloc(sizeof(struct raidlist_itself));
    916     if (!mountlist || !raidlist) {
    917         fatal_error("Cannot malloc() mountlist and/or raidlist");
    918     }
     915    mountlist = mr_malloc(sizeof(struct mountlist_itself));
     916    raidlist = mr_malloc(sizeof(struct raidlist_itself));
    919917
    920918    strcpy(bkpinfo->restore_path, "/");
     
    966964        eject_device(bkpinfo->media_device);
    967965    }
    968     paranoid_free(old_restpath);
    969     free(mountlist);
    970     free(raidlist);
     966    mr_free(old_restpath);
     967    mr_free(mountlist);
     968    mr_free(raidlist);
    971969    return (retval);
    972970}
     
    10381036
    10391037    pathname_of_last_file_restored[0] = '\0';
    1040     if (!(bigblk = malloc(TAPE_BLOCK_SIZE))) {
    1041         fatal_error("Cannot malloc bigblk");
    1042     }
     1038    bigblk = mr_malloc(TAPE_BLOCK_SIZE);
    10431039
    10441040    if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) {
     
    12951291        utime(outfile_fname, ubuf);
    12961292    }
    1297     paranoid_free(bigblk);
    1298     paranoid_free(checksum);
    1299     paranoid_free(outfile_fname);
    1300     paranoid_free(tmp);
    1301     paranoid_free(bzip2_command);
    1302     paranoid_free(ntfsprog_command);
    1303     paranoid_free(suffix);
    1304     paranoid_free(sz_devfile);
     1293    mr_free(bigblk);
     1294    mr_free(checksum);
     1295    mr_free(outfile_fname);
     1296    mr_free(tmp);
     1297    mr_free(bzip2_command);
     1298    mr_free(ntfsprog_command);
     1299    mr_free(suffix);
     1300    mr_free(sz_devfile);
    13051301
    13061302    return (retval);
     
    15531549    }
    15541550
    1555     paranoid_free(tmp);
    1556     paranoid_free(outfile_fname);
    1557     paranoid_free(command);
    1558     paranoid_free(ntfsprog_command);
    1559     paranoid_free(sz_devfile);
    1560     paranoid_free(ntfsprog_fifo);
     1551    mr_free(tmp);
     1552    mr_free(outfile_fname);
     1553    mr_free(command);
     1554    mr_free(ntfsprog_command);
     1555    mr_free(sz_devfile);
     1556    mr_free(ntfsprog_fifo);
    15611557    g_loglevel = old_loglevel;
    15621558    return (retval);
     
    17861782
    17871783  leave_sub:
    1788     paranoid_free(command);
    1789     paranoid_free(tmp);
    1790     paranoid_free(filelist_name);
    1791     paranoid_free(filelist_subset_fname);
    1792     paranoid_free(executable);
    1793     paranoid_free(temp_log);
    1794     paranoid_free(xattr_fname);
    1795     paranoid_free(acl_fname);
     1784    mr_free(command);
     1785    mr_free(tmp);
     1786    mr_free(filelist_name);
     1787    mr_free(filelist_subset_fname);
     1788    mr_free(executable);
     1789    mr_free(temp_log);
     1790    mr_free(xattr_fname);
     1791    mr_free(acl_fname);
    17961792    log_msg(5, "Leaving");
    17971793    return (retval);
     
    19881984    unlink(afio_fname);
    19891985
    1990     paranoid_free(filelist_subset_fname);
    1991     paranoid_free(filelist_fname);
    1992     paranoid_free(afio_fname);
    1993     paranoid_free(command);
    1994     paranoid_free(tmp);
     1986    mr_free(filelist_subset_fname);
     1987    mr_free(filelist_fname);
     1988    mr_free(afio_fname);
     1989    mr_free(command);
     1990    mr_free(tmp);
    19951991    return (retval);
    19961992}
     
    21372133        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    21382134    }
    2139     paranoid_free(xattr_fname);
    2140     paranoid_free(acl_fname);
    2141     paranoid_free(tmp);
    2142     paranoid_free(biggies_whose_EXATs_we_should_set);
    2143     paranoid_free(pathname_of_last_biggie_restored);
     2135    mr_free(xattr_fname);
     2136    mr_free(acl_fname);
     2137    mr_free(tmp);
     2138    mr_free(biggies_whose_EXATs_we_should_set);
     2139    mr_free(pathname_of_last_biggie_restored);
    21442140    return (retval);
    21452141}
     
    22862282        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    22872283    }
    2288     paranoid_free(tmp);
    2289     paranoid_free(tarball_fname);
    2290     paranoid_free(progress_str);
    2291     paranoid_free(comment);
     2284    mr_free(tmp);
     2285    mr_free(tarball_fname);
     2286    mr_free(progress_str);
     2287    mr_free(comment);
    22922288
    22932289    return (retval);
     
    24572453        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    24582454    }
    2459     paranoid_free(biggies_whose_EXATs_we_should_set);
    2460     paranoid_free(pathname_of_last_biggie_restored);
    2461     paranoid_free(biggie_fname);
    2462     paranoid_free(biggie_cksum);
    2463     paranoid_free(xattr_fname);
    2464     paranoid_free(acl_fname);
    2465     paranoid_free(tmp);
     2455    mr_free(biggies_whose_EXATs_we_should_set);
     2456    mr_free(pathname_of_last_biggie_restored);
     2457    mr_free(biggie_fname);
     2458    mr_free(biggie_cksum);
     2459    mr_free(xattr_fname);
     2460    mr_free(acl_fname);
     2461    mr_free(tmp);
    24662462    return (retval);
    24672463}
     
    26032599        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    26042600    }
    2605     paranoid_free(tmp);
    2606     paranoid_free(progress_str);
    2607     paranoid_free(tmp_fname);
    2608     paranoid_free(xattr_fname);
    2609     paranoid_free(acl_fname);
     2601    mr_free(tmp);
     2602    mr_free(progress_str);
     2603    mr_free(tmp_fname);
     2604    mr_free(xattr_fname);
     2605    mr_free(acl_fname);
    26102606    return (retval);
    26112607}
     
    26922688    kill_petris();
    26932689    log_msg(2, "restore_everything() --- leaving");
    2694     paranoid_free(cwd);
    2695     paranoid_free(newpath);
    2696     paranoid_free(tmp);
     2690    mr_free(cwd);
     2691    mr_free(newpath);
     2692    mr_free(tmp);
    26972693    return (resA + resB);
    26982694}
     
    29142910        g_text_mode = FALSE;
    29152911    }                           // newt :-)
    2916     if (!
    2917         (bkpinfo = g_bkpinfo_DONTUSETHIS =
    2918          malloc(sizeof(struct s_bkpinfo)))) {
    2919         fatal_error("Cannot malloc bkpinfo");
    2920     }
    2921     if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
    2922         fatal_error("Cannot malloc mountlist");
    2923     }
    2924     if (!(raidlist = malloc(sizeof(struct raidlist_itself)))) {
    2925         fatal_error("Cannot malloc raidlist");
    2926     }
     2912    bkpinfo = g_bkpinfo_DONTUSETHIS = mr_malloc(sizeof(struct s_bkpinfo));
     2913    mountlist = mr_malloc(sizeof(struct mountlist_itself));
     2914    raidlist = mr_malloc(sizeof(struct raidlist_itself));
    29272915
    29282916    malloc_libmondo_global_strings();
     
    33443332    sprintf(tmp, "umount %s", bkpinfo->isodir);
    33453333    run_program_and_log_output(tmp, 5);
    3346     paranoid_free(mountlist);
    3347     paranoid_free(raidlist);
     3334    mr_free(mountlist);
     3335    mr_free(raidlist);
    33483336    if (am_I_in_disaster_recovery_mode()) {
    33493337        run_program_and_log_output("mount / -o remount,rw", 2);
     
    33513339    paranoid_MR_finish(retval); // frees global stuff plus bkpinfo
    33523340    free_libmondo_global_strings(); // it's fine to have this here :) really :)
    3353     paranoid_free(a);
    3354     paranoid_free(b);
    3355     paranoid_free(tmp);
     3341    mr_free(a);
     3342    mr_free(b);
     3343    mr_free(tmp);
    33563344
    33573345    unlink("/tmp/filelist.full");
Note: See TracChangeset for help on using the changeset viewer.