Ticket #10229: 0001-Fixed-resource-leak-CID-702031.2.patch

File 0001-Fixed-resource-leak-CID-702031.2.patch, 1.2 KB (added by Ezodev, 10 years ago)
  • src/apps/terminal/Shell.cpp

    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)  
    432432        fprintf(stderr, "Failed to init pseudo tty.");
    433433        return errno;
    434434    }
    435 
     435   
     436    // close the PTY master side
     437    close(master);
     438   
    436439    /*
    437440     * Get the modes of the current terminal. We will duplicates these
    438441     * on the pseudo terminal.
    Shell::_Spawn(int row, int col, const ShellParameters& parameters)  
    446449        close(master);
    447450        return B_ERROR;
    448451    }
    449 
     452       
    450453    handshake_t handshake;
    451454
    452455    if (fShellInfo.ProcessID() == 0) {
    453456        // Now in child process.
    454457
    455         // close the PTY master side
    456         close(master);
    457 
    458458        /*
    459459         * Make our controlling tty the pseudo tty. This hapens because
    460460         * we cleared our original controlling terminal above.