return line;
}
while (!feof(file)) {
- line = NULL;
if (getline(&line, &dummy, file) <= 0)
break;
if (strstr(line, "BUILD") != NULL) {
c = strstr(line, "BUILD");
c += 7;
- build = strdup(c);
+ if (!(build = strdup(c)))
+ break;
c = strchr(build, '\n');
if (c) *c = 0;
free(line);
fclose(file);
return build;
- } else {
- free(line);
}
}
fclose(file);
+ free(line);
line = strdup("Unknown");
}
while (!feof(file)) {
- line = NULL;
if (getline(&line, &dummy, file) <= 0)
break;
}
fclose(file);
+ free(line);
line = strdup("Unknown");
if ((c = strdup(appfile)))
files = g_list_prepend(files, c);
+ free(txt);
return files;
}