Dont free everytime getline() is used, fix from Stefan Soucek
This commit is contained in:
parent
3be34309e3
commit
b8f5adb64f
@ -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
3
dpkg.c
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user