From 79169c711fa8753912140c255fe61bfbf422c259 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 3 Oct 2014 11:22:37 -0600 Subject: [PATCH] fix reversed in/out file closing when an error occurs. From Ken Pettit --- nshlib/nsh_ddcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nshlib/nsh_ddcmd.c b/nshlib/nsh_ddcmd.c index 58298ea7a..a2d14c003 100644 --- a/nshlib/nsh_ddcmd.c +++ b/nshlib/nsh_ddcmd.c @@ -621,10 +621,10 @@ int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) ret = OK; errout_with_outf: - DD_INCLOSE(&dd); + DD_OUTCLOSE(&dd); errout_with_inf: - DD_OUTCLOSE(&dd); + DD_INCLOSE(&dd); free(dd.buffer); errout_with_paths: