[Sound-open-firmware] [PATCH 3/3] rmbox: make sure we close all files

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Jun 15 15:36:40 CEST 2017


Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 rmbox/rmbox.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rmbox/rmbox.c b/rmbox/rmbox.c
index f5e9c34..83d3c6e 100644
--- a/rmbox/rmbox.c
+++ b/rmbox/rmbox.c
@@ -230,6 +230,8 @@ static int snapshot(const char *name)
 			addr += 4;
 		}
 
+		fclose(in_fd);
+		fclose(out_fd);
 	}
 
 	return 0;
@@ -281,6 +283,7 @@ int main(int argc, char *argv[])
 	if (out_fd == NULL) {
 		fprintf(stderr, "error: unable to open %s for writing %d\n",
 			out_file, errno);
+		fclose(in_fd);
 		return -EIO;
 	}
 
-- 
1.9.1



More information about the Sound-open-firmware mailing list