]> Git Repo - qemu.git/blobdiff - block/curl.c
target-sparc64: implement Short Floating-Point Store Instructions
[qemu.git] / block / curl.c
index 79ff2f1e41192fb6e22850de4742ca8c4f4518b2..d4b85d20a5a8cc73e1b18ba947fe1e3f429ad750 100644 (file)
@@ -640,7 +640,13 @@ static void curl_readv_bh_cb(void *p)
     state->buf_start = start;
     state->buf_len = acb->end + s->readahead_size;
     end = MIN(start + state->buf_len, s->len) - 1;
-    state->orig_buf = g_malloc(state->buf_len);
+    state->orig_buf = g_try_malloc(state->buf_len);
+    if (state->buf_len && state->orig_buf == NULL) {
+        curl_clean_state(state);
+        acb->common.cb(acb->common.opaque, -ENOMEM);
+        qemu_aio_release(acb);
+        return;
+    }
     state->acb[0] = acb;
 
     snprintf(state->range, 127, "%zd-%zd", start, end);
This page took 0.02415 seconds and 4 git commands to generate.