From 106af0e251ec0cb1237f5bcc4814d79c76048819 Mon Sep 17 00:00:00 2001 From: gdt Date: Wed, 31 Jan 2007 18:10:53 +0000 Subject: 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 --- gnuradio-core/src/lib/runtime/gr_vmcircbuf_sysv_shm.cc | 2 ++ 1 file changed, 2 insertions(+) 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"); } -- cgit