From cb074b2119b640a85f3eb29de377b7d6167c4187 Mon Sep 17 00:00:00 2001
From: Ezo <ezo.dev@gmail.com>
Date: Fri, 22 Nov 2013 17:24:21 +0000
Subject: [PATCH] Fixed Resource Leak CID:702031
---
src/apps/terminal/Shell.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp
index ebfe8f2..4ddbb25 100644
a
|
b
|
Shell::_Spawn(int row, int col, const ShellParameters& parameters)
|
432 | 432 | fprintf(stderr, "Failed to init pseudo tty."); |
433 | 433 | return errno; |
434 | 434 | } |
| 435 | |
| 436 | close(master); |
435 | 437 | |
436 | 438 | /* |
437 | 439 | * Get the modes of the current terminal. We will duplicates these |
… |
… |
Shell::_Spawn(int row, int col, const ShellParameters& parameters)
|
443 | 445 | /* Fork a child process. */ |
444 | 446 | fShellInfo.SetProcessID(fork()); |
445 | 447 | if (fShellInfo.ProcessID() < 0) { |
446 | | close(master); |
447 | 448 | return B_ERROR; |
448 | 449 | } |
449 | 450 | |
… |
… |
Shell::_Spawn(int row, int col, const ShellParameters& parameters)
|
452 | 453 | if (fShellInfo.ProcessID() == 0) { |
453 | 454 | // Now in child process. |
454 | 455 | |
455 | | // close the PTY master side |
456 | | close(master); |
457 | | |
458 | 456 | /* |
459 | 457 | * Make our controlling tty the pseudo tty. This hapens because |
460 | 458 | * we cleared our original controlling terminal above. |