diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-11-27 23:03:15 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-11-27 23:03:15 +0100 |
commit | fa5e833a50c1e18cee29ca7fb660cc423904a024 (patch) | |
tree | 5e3d296c08c8c5f79eed1d3d3ec22e2080c8b546 /pflocal/io.c | |
parent | bf0dd12b0b4cde2f638f82102c8ac3964b3ecaed (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 'pflocal/io.c')
-rw-r--r-- | pflocal/io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pflocal/io.c b/pflocal/io.c index 74c2f970..36221a66 100644 --- a/pflocal/io.c +++ b/pflocal/io.c @@ -106,7 +106,7 @@ S_io_write (struct sock_user *user, { err = pipe_write (pipe, user->sock->flags & SOCK_NONBLOCK, source_addr, data, data_len, amount); - if (source_addr) + if (err && source_addr) ports_port_deref (source_addr); } |