int count = 0;
size_t size = 512;
- buf = malloc (size);
+ buf = calloc (1, size);
while (fgets(buf, size, fp)) {
while (strlen (buf) == (size - 1)
char *new;
char *dest, *src, *end;
- new = malloc(strlen(line) + 1);
+ new = calloc(1, strlen(line) + 1);
if ( new == NULL ){
fprintf(stderr,"%s: Unable to allocate memory\n",__FUNCTION__);
return NULL;
struct errlist *err_lst_tmp;
- err_lst_tmp = malloc ( sizeof (err_lst_tmp) );
+ err_lst_tmp = calloc (1, sizeof (err_lst_tmp) );
err_lst_tmp->errmsg=strdup(msg) ;
err_lst_tmp->next = *errors;
*errors = err_lst_tmp;