summaryrefslogtreecommitdiff
path: root/libpipe
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-27 23:03:15 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-27 23:03:15 +0100
commitfa5e833a50c1e18cee29ca7fb660cc423904a024 (patch)
tree5e3d296c08c8c5f79eed1d3d3ec22e2080c8b546 /libpipe
parentbf0dd12b0b4cde2f638f82102c8ac3964b3ecaed (diff)
Fix source address reference accounting
* libpipe/pipe.c (pipe_recv): If `source' is NULL but packet source exists, dereference it. * pflocal/io.c (S_io_write): Only dereference the source on errors.
Diffstat (limited to 'libpipe')
-rw-r--r--libpipe/pipe.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index 914816bc..4580b3ab 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -383,6 +383,8 @@ pipe_recv (struct pipe *pipe, int noblock, unsigned *flags, void **source,
if (source)
packet_read_source (packet, source);
+ else if (packet->source)
+ pipe_dealloc_addr(packet->source);
err = (*pipe->class->read)(packet, &dq, flags,
data, data_len, amount);