Merge pull request #1435 from tridge/pullrequest-fix-stream-leak

mixer: fixed stream handle leakage
This commit is contained in:
Lorenz Meier 2014-11-12 13:39:44 +01:00
commit 2f3ffdd508

View File

@ -91,6 +91,7 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen)
/* if the line is too long to fit in the buffer, bail */
if ((strlen(line) + strlen(buf) + 1) >= maxlen) {
warnx("line too long");
fclose(fp);
return -1;
}
@ -98,6 +99,7 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen)
strcat(buf, line);
}
fclose(fp);
return 0;
}