summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdt2007-01-31 18:10:53 +0000
committergdt2007-01-31 18:10:53 +0000
commit106af0e251ec0cb1237f5bcc4814d79c76048819 (patch)
tree5d56c20459cfe8c0928aed76e6df27b070bd1a4c
parent868b49fe7cd9ea52fe534420d48973873a0e7930 (diff)
downloadgnuradio-106af0e251ec0cb1237f5bcc4814d79c76048819.tar.gz
gnuradio-106af0e251ec0cb1237f5bcc4814d79c76048819.tar.bz2
gnuradio-106af0e251ec0cb1237f5bcc4814d79c76048819.zip
free schmid_guard on error paths where it has been allocated and not
freed. Fixes shm leak on NetBSD which hits the error case for unknown reasons. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4346 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--gnuradio-core/src/lib/runtime/gr_vmcircbuf_sysv_shm.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_sysv_shm.cc b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_sysv_shm.cc
index fe0322f73..ccb169b95 100644
--- a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_sysv_shm.cc
+++ b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_sysv_shm.cc
@@ -68,11 +68,13 @@ gr_vmcircbuf_sysv_shm::gr_vmcircbuf_sysv_shm (int size)
if ((shmid2 = shmget (IPC_PRIVATE, 2 * size + 2 * pagesize, IPC_CREAT | 0700)) == -1){
perror ("gr_vmcircbuf_sysv_shm: shmget (1)");
+ shmctl (shmid_guard, IPC_RMID, 0);
throw std::runtime_error ("gr_vmcircbuf_sysv_shm");
}
if ((shmid1 = shmget (IPC_PRIVATE, size, IPC_CREAT | 0700)) == -1){
perror ("gr_vmcircbuf_sysv_shm: shmget (2)");
+ shmctl (shmid_guard, IPC_RMID, 0);
shmctl (shmid2, IPC_RMID, 0);
throw std::runtime_error ("gr_vmcircbuf_sysv_shm");
}