Get address sanitizer mostly working

This commit is contained in:
Justine Tunney 2020-09-03 05:44:37 -07:00
parent 1f1f3cd477
commit 7327c345f9
149 changed files with 3777 additions and 3457 deletions

View file

@ -45,10 +45,11 @@
*/
int parsehoststxt(struct HostsTxt *ht, FILE *f) {
int rc = 0;
char stackline[128];
char *line = stackline;
size_t linecap = sizeof(stackline);
while ((getline(&line, &linecap, f)) != -1) {
char *line;
size_t linesize;
line = NULL;
linesize = 0;
while ((getline(&line, &linesize, f)) != -1) {
struct HostsTxtEntry entry;
char *addr, *name, *tok, *comment;
if ((comment = strchr(line, '#'))) *comment = '\0';
@ -64,6 +65,6 @@ int parsehoststxt(struct HostsTxt *ht, FILE *f) {
}
}
}
free_s(&line);
free(line);
return rc | ferror(f);
}