Ignore:
Timestamp:
Nov 10, 2016, 9:09:54 PM (7 years ago)
Author:
Bruno Cornec
Message:

Remove more static allocation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/mondorestore/mondo-rstr-mountlist.c

    r3564 r3611  
    5555    /*@ buffers ******************************************************** */
    5656    char tmp = NULL;
     57    char tmp1 = NULL;
    5758    char device[MAX_STR_LEN];
    5859
     
    112113            }
    113114            if (device_copies > 1) {
    114                 mr_asprintf(tmp, " %s %s's.", number_to_text(device_copies), device);
     115                tmp1 = number_to_text(device_copies);
     116                mr_asprintf(tmp, " %s %s's.", tmp1, device);
     117                mr_free(tmp1);
    115118                if (!strstr(flaws_str, tmp)) {
    116119                    log_it(tmp);
     
    209212            }
    210213            if (device_copies > 1) {
    211                 mr_asprintf(tmp, " %s %s's.", number_to_text(device_copies), device);
     214                tmp1 = number_to_text(device_copies);
     215                mr_asprintf(tmp, " %s %s's.", tmp1, device);
     216                mr_free(tmp1);
    212217                if (!strstr(flaws_str, "%s", tmp)) {
    213218                    log_it(tmp);
     
    271276                }
    272277                if (device_copies > 1) {
    273                     mr_asprintf(tmp, " %s %s's.", number_to_text(device_copies), device);
     278                    tmp1 = number_to_text(device_copies);
     279                    mr_asprintf(tmp, " %s %s's.", tmp1, device);
     280                    mr_free(tmp1);
    274281                    if (!strstr(flaws_str, tmp)) {
    275282                        log_it(tmp);
     
    374381    /*@ buffers ******************************************************** */
    375382    char *tmp = NULL;
     383    char *tmp1 = NULL;
    376384    char *device = NULL;
    377385    char *flaws_str = NULL;
     
    452460        }
    453461        if (device_copies > 1) {
    454             mr_asprintf(tmp, " %s %s's.", number_to_text(device_copies), device);
     462            tmp1 = number_to_text(device_copies);
     463            mr_asprintf(tmp, " %s %s's.", tmp1, device);
     464            mr_free(tmp1);
    455465            if (!strstr(flaws_str, tmp)) {
    456466                log_it(tmp);
     
    536546    struct list_of_disks *drivelist;
    537547    char *tmp = NULL;
     548    char *tmp1 = NULL;
    538549    char *flaws_str = NULL;
    539550
     
    589600        }
    590601        if (copies > 1 && last_copy == currline && strcmp(curr_mountpoint, "raid")) {
    591             mr_asprintf(tmp, " %s %s's.", number_to_text(copies), curr_mountpoint);
     602            tmp1 = number_to_text(copies);
     603            mr_asprintf(tmp, " %s %s's.", tmp1, curr_mountpoint);
     604            mr_free(tmp1);
    592605            log_msg(8,"Adding: %s to flaws_str", tmp);
    593606            if (flaws_str != NULL) {
Note: See TracChangeset for help on using the changeset viewer.