aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-01-27 16:54:15 +0100
committerpespin <pespin@sysmocom.de>2021-01-29 11:21:09 +0000
commit377645d6005e6b04c5dcd455324a49eea66d38de (patch)
tree51cc23d91f3a6bdb5ea20846bb253a420477a2f1 /src
parent9043205cd9b936801a0071782747677d6f13e26e (diff)
ctrl_connection: Initialize write_queue.bfd.fd to -1 during allocation
Otherwise fd is set to 0 by default, let's avoid accidentally closing it if something goes wrong. Change-Id: I98f744d2880fbb883719cdf1d3eb31f2b22a13b6
Diffstat (limited to 'src')
-rw-r--r--src/ctrl/control_if.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index 9e3e3a9e..5eb81c7b 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -514,6 +514,7 @@ struct ctrl_connection *osmo_ctrl_conn_alloc(void *ctx, void *data)
INIT_LLIST_HEAD(&ccon->def_cmds);
ccon->write_queue.bfd.data = data;
+ ccon->write_queue.bfd.fd = -1;
ccon->write_queue.write_cb = control_write_cb;
ccon->write_queue.read_cb = handle_control_read;