diff options
author | NIIBE Yutaka <[email protected]> | 2019-09-18 07:40:58 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2019-09-18 07:40:58 +0000 |
commit | f41991480aaa79db55e75363dfbb4f278cb8ea21 (patch) | |
tree | f93368fa7c177020961d89b7de4516eaa7f3c593 | |
parent | core: Fix broken strings (first letter missing) (diff) | |
download | libgpg-error-f41991480aaa79db55e75363dfbb4f278cb8ea21.tar.gz libgpg-error-f41991480aaa79db55e75363dfbb4f278cb8ea21.zip |
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 <[email protected]>
-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 (); |