Revision 7267c094 ui/vnc-jobs-async.c

b/ui/vnc-jobs-async.c
77 77

  
78 78
VncJob *vnc_job_new(VncState *vs)
79 79
{
80
    VncJob *job = qemu_mallocz(sizeof(VncJob));
80
    VncJob *job = g_malloc0(sizeof(VncJob));
81 81

  
82 82
    job->vs = vs;
83 83
    vnc_lock_queue(queue);
......
88 88

  
89 89
int vnc_job_add_rect(VncJob *job, int x, int y, int w, int h)
90 90
{
91
    VncRectEntry *entry = qemu_mallocz(sizeof(VncRectEntry));
91
    VncRectEntry *entry = g_malloc0(sizeof(VncRectEntry));
92 92

  
93 93
    entry->rect.x = x;
94 94
    entry->rect.y = y;
......
105 105
{
106 106
    vnc_lock_queue(queue);
107 107
    if (queue->exit || QLIST_EMPTY(&job->rectangles)) {
108
        qemu_free(job);
108
        g_free(job);
109 109
    } else {
110 110
        QTAILQ_INSERT_TAIL(&queue->jobs, job, next);
111 111
        qemu_cond_broadcast(&queue->cond);
......
246 246
        if (n >= 0) {
247 247
            n_rectangles += n;
248 248
        }
249
        qemu_free(entry);
249
        g_free(entry);
250 250
    }
251 251
    vnc_unlock_display(job->vs->vd);
252 252

  
......
276 276
    QTAILQ_REMOVE(&queue->jobs, job, next);
277 277
    vnc_unlock_queue(queue);
278 278
    qemu_cond_broadcast(&queue->cond);
279
    qemu_free(job);
279
    g_free(job);
280 280
    return 0;
281 281
}
282 282

  
283 283
static VncJobQueue *vnc_queue_init(void)
284 284
{
285
    VncJobQueue *queue = qemu_mallocz(sizeof(VncJobQueue));
285
    VncJobQueue *queue = g_malloc0(sizeof(VncJobQueue));
286 286

  
287 287
    qemu_cond_init(&queue->cond);
288 288
    qemu_mutex_init(&queue->mutex);
......
295 295
    qemu_cond_destroy(&queue->cond);
296 296
    qemu_mutex_destroy(&queue->mutex);
297 297
    buffer_free(&queue->buffer);
298
    qemu_free(q);
298
    g_free(q);
299 299
    queue = NULL; /* Unset global queue */
300 300
}
301 301

  

Also available in: Unified diff