Ignore:
Timestamp:
Jan 28, 2007, 7:04:41 PM (17 years ago)
Author:
Bruno Cornec
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/common/libmondo-fork.c

    r1075 r1080  
    55
    66#include "my-stuff.h"
     7#include "mr_mem.h"
    78#include "mondostructures.h"
    89#include "libmondo-fork.h"
     
    106107    assert_string_is_neither_NULL_nor_zerolength(isofile);
    107108    assert_string_is_neither_NULL_nor_zerolength(logstub);
    108     if (!(midway_call = malloc(1200))) {
    109         fatal_error("Cannot malloc midway_call");
    110     }
    111     if (!(ultimate_call = malloc(1200))) {
    112         fatal_error("Cannot malloc ultimate_call");
    113     }
    114     if (!(tmp = malloc(1200))) {
    115         fatal_error("Cannot malloc tmp");
    116     }
    117     if (!(command = malloc(1200))) {
    118         fatal_error("Cannot malloc command");
    119     }
     109    midway_call = mr_malloc(1200);
     110    ultimate_call = mr_malloc(1200);
     111    tmp = mr_malloc(1200);
     112    command = mr_malloc(1200);
    120113    malloc_string(incoming);
    121114    malloc_string(old_stderr);
     
    178171    }
    179172
    180     paranoid_free(midway_call);
    181     paranoid_free(ultimate_call);
    182     paranoid_free(tmp);
    183     paranoid_free(command);
    184     paranoid_free(incoming);
    185     paranoid_free(old_stderr);
    186     paranoid_free(cd_number_str);
     173    mr_free(midway_call);
     174    mr_free(ultimate_call);
     175    mr_free(tmp);
     176    mr_free(command);
     177    mr_free(incoming);
     178    mr_free(old_stderr);
     179    mr_free(cd_number_str);
    187180/*
    188181  if (bkpinfo->backup_media_type == dvd && !bkpinfo->please_dont_eject_when_restoring)
     
    424417    tmp[0] = '\0';
    425418    bufcap = 256L * 1024L;
    426     if (!(buf = malloc(bufcap))) {
    427         fatal_error("Failed to malloc() buf");
    428     }
     419    buf = mr_malloc(bufcap);
    429420
    430421    if (direction == 'w') {
     
    529520    }
    530521
    531     paranoid_free(buf);
    532     paranoid_free(tmp);
     522    mr_free(buf);
     523    mr_free(tmp);
    533524    log_msg(3, "Successfully copied %ld bytes", bytes_written_out);
    534525    return (retval);
     
    559550    sprintf(command, "ntfsclone --force --save-image --overwrite %s %s", output_fname, input_device);
    560551    res = run_program_and_log_output(command, 5);
    561     paranoid_free(command);
     552    mr_free(command);
    562553    unlink(output_fname);
    563554    return (res);
     
    627618    }
    628619    unlink(tempfile);
    629     paranoid_free(command);
    630     paranoid_free(tempfile);
    631     paranoid_free(title);
     620    mr_free(command);
     621    mr_free(tempfile);
     622    mr_free(title);
    632623    return (res);
    633624}
     
    721712    }
    722713    log_msg(3, "Parent res = %d", res);
    723     paranoid_free(command);
    724     paranoid_free(title);
     714    mr_free(command);
     715    mr_free(title);
    725716    return (res);
    726717}
     
    747738    sprintf(command, "ntfsclone --force --restore-image --overwrite %s %s", output_device, input_fifo);
    748739    res = run_program_and_log_output(command, 5);
    749     paranoid_free(command);
     740    mr_free(command);
    750741    return (res);
    751742}
Note: See TracChangeset for help on using the changeset viewer.