Ignore:
Timestamp:
May 6, 2014, 10:24:12 AM (6 years ago)
Author:
Bruno Cornec
Message:
  • Improve again memory management: remove some strcat calls change function percent_media_full_comment to return a dynamically allocated string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3278 r3288  
    16871687    int c = 0;
    16881688    int lastpos = 0;
    1689     char VG[MAX_STR_LEN];
     1689    char *VG = NULL;
    16901690    char *tmp = NULL;
    16911691    char *command = NULL;
     
    18491849            mr_asprintf(command, "pvdisplay -v %s 2>/dev/null|grep \"VG Name\"|awk '{print $NF}'", partitions[i]);
    18501850            log_msg(5, "  Running: %s", command);
    1851             strcpy(VG, call_program_and_get_last_line_of_output(command));
     1851            mr_asprintf(VG, "%s", call_program_and_get_last_line_of_output(command));
    18521852            mr_free(command);
    18531853
     
    19121912            }
    19131913            mr_free(tmp);
     1914            mr_free(VG);
    19141915            continue;
    19151916        } else {
Note: See TracChangeset for help on using the changeset viewer.