diff options
author | Andrew Tridgell <tridge@samba.org> | 2014-11-05 21:19:04 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2014-11-07 11:43:59 +1100 |
commit | 3f3353f2c4ad9f7b8263379c8b31bd9a437b0174 (patch) | |
tree | 38b54dd091e86b548647f4de10c553b9809aeed6 /src | |
parent | 25df841118316d51fbd6a1f36b56712147911a2b (diff) | |
download | px4-firmware-3f3353f2c4ad9f7b8263379c8b31bd9a437b0174.tar.gz px4-firmware-3f3353f2c4ad9f7b8263379c8b31bd9a437b0174.tar.bz2 px4-firmware-3f3353f2c4ad9f7b8263379c8b31bd9a437b0174.zip |
mixer: fixed stream handle leakage
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/systemlib/mixer/mixer_load.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/systemlib/mixer/mixer_load.c b/src/modules/systemlib/mixer/mixer_load.c index bf3428a50..0d629d610 100644 --- a/src/modules/systemlib/mixer/mixer_load.c +++ b/src/modules/systemlib/mixer/mixer_load.c @@ -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; } |