Skip to content

Commit

Permalink
resource leak if exception in SerialImpl constructor (wjwwood#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
dontsovcmc authored and wjwwood committed Nov 21, 2016
1 parent d76b7d6 commit c16faab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/impl/win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Serial::SerialImpl::SerialImpl (const string &port, unsigned long baudrate,
baudrate_ (baudrate), parity_ (parity),
bytesize_ (bytesize), stopbits_ (stopbits), flowcontrol_ (flowcontrol)
{
read_mutex = CreateMutex(NULL, false, NULL);
write_mutex = CreateMutex(NULL, false, NULL);
if (port_.empty () == false)
open ();
read_mutex = CreateMutex(NULL, false, NULL);
write_mutex = CreateMutex(NULL, false, NULL);
}

Serial::SerialImpl::~SerialImpl ()
Expand Down

0 comments on commit c16faab

Please sign in to comment.