summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-07-19 21:03:31 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-07-19 21:03:31 +0200
commitba57c061ae0ade749701214e582455c952886d32 (patch)
tree73b20ac2da0ee1f23d1d1f4af0feeec9e0aedb9f /src
parent8f15211404c96d80562b9c10cb30ed6e7a8e4b76 (diff)
stream: don't access stream object after calling error-handler
Diffstat (limited to 'src')
-rw-r--r--src/stream.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/stream.c b/src/stream.c
index 9250fe2..24721d2 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -18,11 +18,13 @@ enum {
static void stream_close(struct stream *strm, int err)
{
+ stream_error_h *errorh = strm->errorh;
+
strm->terminated = true;
+ strm->errorh = NULL;
- if (strm->errorh) {
- strm->errorh(strm, err, strm->errorh_arg);
- strm->errorh = NULL;
+ if (errorh) {
+ errorh(strm, err, strm->errorh_arg);
}
}