aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-07-14 21:12:50 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-07-15 15:39:33 +0200
commita2ff733ac0570f70e350c8428b6f1146df07d643 (patch)
treed991385ab01fd0c7d5231702684c920deb50c15a
parent8737ad4f75331e68b94b15fd3da270e7335ba594 (diff)
ipaccess: Set bfd->data to NULL before releasing its reference
Since the reference is dropped, make sure no one accesses it through that pointer anymore. It must be done before calling the put() method, otherwise it may already be released when put() returns. Change-Id: Ic3f261b2a995efcbc8eece9669ee3ae63af7b5c0
-rw-r--r--src/input/ipaccess.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 4d55e71..3ff59f4 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -661,6 +661,7 @@ err_socket:
err_line:
close(bfd->fd);
bfd->fd = -1;
+ bfd->data = NULL;
e1inp_line_put2(line, "ipa_bfd");
return ret;
}
@@ -711,6 +712,7 @@ err_socket:
err_line:
close(bfd->fd);
bfd->fd = -1;
+ bfd->data = NULL;
e1inp_line_put2(line, "ipa_bfd");
return ret;
}