Dont free everytime getline() is used, fix from Stefan Soucek

This commit is contained in:
Glenn L McGrath 2001-09-22 03:24:07 +00:00
parent 3be34309e3
commit b8f5adb64f
2 changed files with 2 additions and 4 deletions

View File

@ -1042,11 +1042,10 @@ char **create_list(const char *filename)
*last_char = '\0'; *last_char = '\0';
} }
file_list[count] = xstrdup(line); file_list[count] = xstrdup(line);
free(line);
count++; count++;
length = 0;
} }
fclose(list_stream); fclose(list_stream);
free(line);
if (count == 0) { if (count == 0) {
return(NULL); return(NULL);

3
dpkg.c
View File

@ -1042,11 +1042,10 @@ char **create_list(const char *filename)
*last_char = '\0'; *last_char = '\0';
} }
file_list[count] = xstrdup(line); file_list[count] = xstrdup(line);
free(line);
count++; count++;
length = 0;
} }
fclose(list_stream); fclose(list_stream);
free(line);
if (count == 0) { if (count == 0) {
return(NULL); return(NULL);