shm: Use the right counter when freeing buffers
authorOlivier Crête <olivier.crete@collabora.co.uk>
Fri, 22 Oct 2010 23:22:43 +0000 (01:22 +0200)
committerOlivier Crête <olivier.crete@collabora.co.uk>
Thu, 25 Nov 2010 00:12:10 +0000 (19:12 -0500)
sys/shm/shmpipe.c

index 9f05f1a..40bd18f 100644 (file)
@@ -548,7 +548,7 @@ sp_writer_send_buf (ShmPipe * self, char *buf, size_t size)
   }
 
   if (c == 0) {
-    spalloc_free1 (sizeof (ShmBuffer) + sizeof (int) * self->num_clients, sb);
+    spalloc_free1 (sizeof (ShmBuffer) + sizeof (int) * sb->num_clients, sb);
     return 0;
   }
 
@@ -784,7 +784,7 @@ sp_shmbuf_dec (ShmPipe * self, ShmBuffer * buf, ShmBuffer * prev_buf)
 
     shm_alloc_space_block_dec (buf->ablock);
     sp_shm_area_dec (self, buf->shm_area);
-    spalloc_free1 (sizeof (ShmBuffer) + sizeof (int) * buf->num_clients, buf);
+    spalloc_free1 (sizeof (ShmBuffer) + sizeof (int) * sb->num_clients, buf);
     return 0;
   }