call_callback(): Fix a shm leak in afs.c.
authorAndre Noll <maan@systemlinux.org>
Thu, 13 Nov 2008 19:55:51 +0000 (20:55 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 13 Nov 2008 19:55:51 +0000 (20:55 +0100)
We forgot to detach the shm area passed from the child which results in
"no space left" messages if many audio files are added and the number
of shared memory areas exceeds 4096.

afs.c

diff --git a/afs.c b/afs.c
index aa008f995c6d7aa8cc0b935c419810c81749613e..5f47941e13cae9b43c454e5573fb26de6588f4e8 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -892,7 +892,7 @@ static int call_callback(int fd, int query_shmid)
        query.data = (char *)query_shm + sizeof(*cq);
        query.size = cq->query_size;
        cq->handler(fd, &query);
-       return 1;
+       return shm_detach(query_shm);
 }
 
 static int execute_server_command(void)