From 412fdaabded1ccdc123dd51f4b4c413bd2db0184 Mon Sep 17 00:00:00 2001
From: Ezo <ezo.dev@gmail.com>
Date: Thu, 21 Nov 2013 04:47:32 +0000
Subject: [PATCH] Fixed resource leak, CID:702031
---
src/apps/terminal/Shell.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp
index ebfe8f2..bdafd9e 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 | | |
| 435 | |
| 436 | // close the PTY master side |
| 437 | close(master); |
| 438 | |
436 | 439 | /* |
437 | 440 | * Get the modes of the current terminal. We will duplicates these |
438 | 441 | * on the pseudo terminal. |
… |
… |
Shell::_Spawn(int row, int col, const ShellParameters& parameters)
|
446 | 449 | close(master); |
447 | 450 | return B_ERROR; |
448 | 451 | } |
449 | | |
| 452 | |
450 | 453 | handshake_t handshake; |
451 | 454 | |
452 | 455 | if (fShellInfo.ProcessID() == 0) { |
453 | 456 | // Now in child process. |
454 | 457 | |
455 | | // close the PTY master side |
456 | | close(master); |
457 | | |
458 | 458 | /* |
459 | 459 | * Make our controlling tty the pseudo tty. This hapens because |
460 | 460 | * we cleared our original controlling terminal above. |