mirror of
https://github.com/troglobit/finit.git
synced 2026-11-19 19:40:50 +00:00
run_interactive(): Fix file descriptor leak when debug is enabled.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f621117eb9
commit
1bdcef9a2c
1 file changed
+3
-1
@@ -552,9 +552,11 @@ int run_interactive(char *cmd, char *fmt, ...)
|
|||||||
len = fread(line, 1, sizeof(line), fp);
|
len = fread(line, 1, sizeof(line), fp);
|
||||||
written = fwrite(line, len, sizeof(char), stderr);
|
written = fwrite(line, len, sizeof(char), stderr);
|
||||||
} while (len > 0 && written == len);
|
} while (len > 0 && written == len);
|
||||||
fclose(fp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fp)
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user