diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-04-30 13:18:05 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-04-30 13:18:05 +0800 |
commit | adebbfdfa74fbbda8e2cf1d92835120bbfb9d0c5 (patch) | |
tree | 1de372afdaea2c95b75f6c682b9424ca424ed036 | |
parent | afccfb9380cc7c06fcacb19410796ba87ddee677 (diff) |
[vty] Plug memory leak on auto completion.
I assume the original code crashed with a double free as we
have a cleanup at the end of the method. Return from the routine
like the case label below. This is fixing a memory leak I am
experimenting.
-rw-r--r-- | openbsc/src/vty/vty.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/vty/vty.c b/openbsc/src/vty/vty.c index 5e4902441..fffa649c7 100644 --- a/openbsc/src/vty/vty.c +++ b/openbsc/src/vty/vty.c @@ -915,7 +915,9 @@ static void vty_complete_command(struct vty *vty) vty_backward_pure_word(vty); vty_insert_word_overwrite(vty, matched[0]); vty_self_insert(vty, ' '); - //talloc_free(matched[0]); + talloc_free(matched[0]); + vector_only_index_free(matched); + return; break; case CMD_COMPLETE_MATCH: vty_prompt(vty); |