diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-06-06 18:25:12 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-06-16 17:23:19 +0800 |
commit | f7047c2daf760385edf83df10be4259bea190e75 (patch) | |
tree | a84a3315f0b8d6f393037032da42b78beccb47b3 /block/curl.c | |
parent | b25c9dff3599892a16f824b5df643e0fc1acbfc1 (diff) |
block: Drop superfluous conditionals around g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/curl.c')
-rw-r--r-- | block/curl.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/block/curl.c b/block/curl.c index 8c84141ced..79ff2f1e41 100644 --- a/block/curl.c +++ b/block/curl.c @@ -440,10 +440,8 @@ static void curl_detach_aio_context(BlockDriverState *bs) curl_easy_cleanup(s->states[i].curl); s->states[i].curl = NULL; } - if (s->states[i].orig_buf) { - g_free(s->states[i].orig_buf); - s->states[i].orig_buf = NULL; - } + g_free(s->states[i].orig_buf); + s->states[i].orig_buf = NULL; } if (s->multi) { curl_multi_cleanup(s->multi); @@ -638,8 +636,7 @@ static void curl_readv_bh_cb(void *p) acb->end = (acb->nb_sectors * SECTOR_SIZE); state->buf_off = 0; - if (state->orig_buf) - g_free(state->orig_buf); + g_free(state->orig_buf); state->buf_start = start; state->buf_len = acb->end + s->readahead_size; end = MIN(start + state->buf_len, s->len) - 1; |