diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-05-01 08:51:17 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-06-24 08:02:34 +0200 |
commit | 25346fe0d7a8b83acdee8332bec921dbb254f016 (patch) | |
tree | 119c2b9df41cab0def2565a4a76926ef0a2bf6c3 /src/osmo-bts-sysmo/calib_file.c | |
parent | a7e75377767e86a3e5645c22239770b1939e9899 (diff) |
sysmobts: Fix potential memory leaks in the prim callback handling
Make sure the l1msg is always freed in the callback. There were
several error conditions were the msgb would not have been freed,
in the case of the calib data and the system information the message
was not freed even in normal condition.
I will modify this code to __use a msgb. This allows to re-use
the allocated msgb across read operations.
Diffstat (limited to 'src/osmo-bts-sysmo/calib_file.c')
-rw-r--r-- | src/osmo-bts-sysmo/calib_file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/calib_file.c b/src/osmo-bts-sysmo/calib_file.c index b886d61f..d8c9fd7d 100644 --- a/src/osmo-bts-sysmo/calib_file.c +++ b/src/osmo-bts-sysmo/calib_file.c @@ -350,6 +350,8 @@ static int calib_send_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg) calib_files[st->last_file_idx].fname, fl1h->calib_path ? "file" : "eeprom"); + msgb_free(l1_msg); + st->last_file_idx++; if (st->last_file_idx < ARRAY_SIZE(calib_files)) |