diff options
author | glebius <glebius@FreeBSD.org> | 2006-10-17 10:59:39 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2006-10-17 10:59:39 +0000 |
commit | 422e6f6f8b294280f533dc932896d7da5e28283b (patch) | |
tree | 4286914a36965ab2f2fdae2a8ff26954e0a233f3 | |
parent | 7715a1bf6318443c346da2c7b4c4485eb2dff9b5 (diff) | |
download | FreeBSD-src-422e6f6f8b294280f533dc932896d7da5e28283b.zip FreeBSD-src-422e6f6f8b294280f533dc932896d7da5e28283b.tar.gz |
- ng_address_ID() has already freed the message, don't do double free.
- Get error from ng_address_ID().
Reported by: Coverity via pjd
-rw-r--r-- | sys/netgraph/netgraph.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 313eac8..fdf78c9 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -962,17 +962,13 @@ _ngi_hook(item_p item, char *file, int line) ng_ID_t _dest = NGI_RETADDR(item); \ NGI_RETADDR(item) = 0; \ NGI_MSG(item) = resp; \ - if ((ng_address_ID((here), (item), \ + if ((error = ng_address_ID((here), (item), \ _dest, 0)) == 0) { \ SAVE_LINE(item); \ (error) = ng_snd_item((item), NG_QUEUE);\ - } else { \ - NG_FREE_ITEM(item); \ - (error) = EINVAL; \ } \ - } else { \ + } else \ NG_FREE_ITEM(item); \ - } \ (item) = NULL; \ } while (0) |