diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-06-08 20:45:25 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-06-12 15:16:41 +0200 |
commit | c8086c317e8554628d0d967740a131c8b7dbd15e (patch) | |
tree | 10e77bdb5c6e09ab3bd7c4ebc77772d785c699e7 /src/common/abis.c | |
parent | 0bf87ccc3e43fb3ed638b6991563a297fd8b041a (diff) |
abis.c: Grab reference to e1inp_line_get if already created
Since we are returning the pointer, it should always be grabbing a
reference (find doesn't do it).
In practice it's not much important since it is always created and not
found.
Change-Id: Ib84636663be2df33d497131c780b010b57f17e32
Diffstat (limited to 'src/common/abis.c')
-rw-r--r-- | src/common/abis.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/abis.c b/src/common/abis.c index 44b8eff2..ab328700 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -280,8 +280,10 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host, bts_dev_info.location2 = model_name; line = e1inp_line_find(0); - if (!line) - line = e1inp_line_create(0, "ipa"); + if (line) + e1inp_line_get(line); /* We want a new reference for returned line */ + else + line = e1inp_line_create(0, "ipa"); /* already comes with a reference */ if (!line) return NULL; e1inp_line_bind_ops(line, &line_ops); |