[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Segmentation fault when deleting TTYStream object
From: |
Jens Theeß |
Subject: |
Segmentation fault when deleting TTYStream object |
Date: |
Tue, 18 May 2004 15:57:31 +0200 |
User-agent: |
Mozilla Thunderbird 0.6 (Windows/20040502) |
I get a segmentation fault when I delete an object derived from a
TTYStream.
The attached patch fix it.
System: commoncpp 1.1.8, SuSE 7.1, Linux 2.4.7 i686, gcc 2.95.3
Strangely, I got no segfault with commoncpp 1.1.1, though I can't see
the reason in the source.
Greetings,
Jens Theeß
--- commoncpp2-1.1.8/src/serial.cpp Thu May 13 18:39:22 2004
+++ commoncpp2-1.1.8.patched/src/serial.cpp Tue May 18 15:01:41 2004
@@ -277,7 +277,7 @@
if(original)
delete (DCB *)original;
#else
- if(dev < 0)
+ if(dev < 0 && original)
tcsetattr(dev, TCSANOW, (struct termios *)original);
if(current)