diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2019-09-18 16:40:58 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-09-18 16:40:58 +0900 |
commit | f41991480aaa79db55e75363dfbb4f278cb8ea21 (patch) | |
tree | f93368fa7c177020961d89b7de4516eaa7f3c593 /src | |
parent | c1e80f6e8e368c271bbf413d9eaea772ef2062d1 (diff) | |
download | libgpg-error-f41991480aaa79db55e75363dfbb4f278cb8ea21.tar.gz |
estream: Care about erroneous case for stream close.
* src/estream.c (do_list_remove): Only access ITEM->NEXT when it's not
null.
GnuPG-bug-id: 4698
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/estream.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/estream.c b/src/estream.c index a23d817..6b531fb 100644 --- a/src/estream.c +++ b/src/estream.c @@ -461,19 +461,14 @@ do_list_remove (estream_t stream, int with_locked_list) else item_prev = item; - if (item_prev) + if (item) { - item_prev->next = item->next; + if (item_prev) + item_prev->next = item->next; + else + estream_list = item->next; mem_free (item); } - else - { - if (item) - { - estream_list = item->next; - mem_free (item); - } - } if (!with_locked_list) unlock_list (); |