From: Paolo Bonzini Date: Mon, 15 May 2017 10:00:53 +0000 (+0200) Subject: curl: strengthen assertion in curl_clean_state X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=675a775633e68bf8b426a896fea5b93a4f4ff1cc;p=qemu.git curl: strengthen assertion in curl_clean_state curl_clean_state should only be called after all AIOCBs have been completed. This is not so obvious for the call from curl_detach_aio_context, so assert that. Cc: qemu-stable@nongnu.org Reviewed-by: Jeff Cody Signed-off-by: Paolo Bonzini Reviewed-by: Max Reitz Message-id: 20170515100059.15795-2-pbonzini@redhat.com Signed-off-by: Jeff Cody --- diff --git a/block/curl.c b/block/curl.c index 43822348d6..562340f436 100644 --- a/block/curl.c +++ b/block/curl.c @@ -533,6 +533,11 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) static void curl_clean_state(CURLState *s) { + int j; + for (j = 0; j < CURL_NUM_ACB; j++) { + assert(!s->acb[j]); + } + if (s->s->multi) curl_multi_remove_handle(s->s->multi, s->curl);