Changeset 1227 in MondoRescue for branches/stable/mondo/src/lib/mr_conf.c


Ignore:
Timestamp:
Mar 6, 2007, 1:13:38 PM (17 years ago)
Author:
Bruno Cornec
Message:

Removal of MRCONF_ALLOC_FAILED as mr_malloc is always returning a pointer or exiting in case of pb.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/lib/mr_conf.c

    r1133 r1227  
    2424#define MRCONF_NO_ERROR             0x0
    2525#define MRCONF_BAD_FILE             0x1
    26 #define MRCONF_ALLOC_FAILED         0x2
    2726#define MRCONF_READING_FAILED       0x3
    2827#define MRCONF_NO_GROUP_START       0x4
     
    115114    /*allocate memory for the buffers */
    116115    buffer = (char *) mr_malloc(sizeof(char) * (length + 1));
    117 
    118     if (buffer == NULL) {
    119         mr_conf_error_msg(MRCONF_ALLOC_FAILED, "");
    120         return (MRCONF_ALLOC_FAILED);
    121     }
    122116
    123117    /*set flag that module is in "open" state */
     
    253247    /*copy filtered data to the buffer */
    254248    ret = (char *) mr_malloc(sizeof(char) * (size));
    255     if (ret == NULL) {
    256         mr_conf_error_msg(MRCONF_ALLOC_FAILED, "");
    257         return (NULL);
    258     }
    259249    while (i < size - 1) {
    260250        ret[i] = *p;
     
    293283    /* k is new buffer length now */
    294284    tmp_buf = (char *) mr_malloc(sizeof(char) * (k + 1));
    295     if (tmp_buf == NULL) {
    296         mr_conf_error_msg(MRCONF_ALLOC_FAILED, "");
    297         return;
    298     }
    299285
    300286    k = 0;
     
    355341            break;
    356342
    357         case MRCONF_ALLOC_FAILED:
    358             mr_msg(0,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_ALLOC_FAILED);
    359             break;
    360 
    361343        case MRCONF_READING_FAILED:
    362344            mr_msg(0,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_READING_FAILED);
Note: See TracChangeset for help on using the changeset viewer.