run_interactive(): Fix file descriptor leak when debug is enabled.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2014-11-26 22:49:31 +01:00
1 parent f621117eb9
commit 1bdcef9a2c
1 file changed
+3 -1
+3 -1
View File
@@ -552,9 +552,11 @@ int run_interactive(char *cmd, char *fmt, ...)
len = fread(line, 1, sizeof(line), fp);
written = fwrite(line, len, sizeof(char), stderr);
} while (len > 0 && written == len);
fclose(fp);
}
if (fp)
fclose(fp);
return status;
}