Revision 7267c094 monitor.c
b/monitor.c | ||
---|---|---|
636 | 636 |
data->user_print(data->mon, ret_data); |
637 | 637 |
} |
638 | 638 |
monitor_resume(data->mon); |
639 |
qemu_free(data);
|
|
639 |
g_free(data);
|
|
640 | 640 |
} |
641 | 641 |
|
642 | 642 |
static void qmp_monitor_complete(void *opaque, QObject *ret_data) |
... | ... | |
660 | 660 |
{ |
661 | 661 |
int ret; |
662 | 662 |
|
663 |
MonitorCompletionData *cb_data = qemu_malloc(sizeof(*cb_data));
|
|
663 |
MonitorCompletionData *cb_data = g_malloc(sizeof(*cb_data));
|
|
664 | 664 |
cb_data->mon = mon; |
665 | 665 |
cb_data->user_print = cmd->user_print; |
666 | 666 |
monitor_suspend(mon); |
... | ... | |
668 | 668 |
user_monitor_complete, cb_data); |
669 | 669 |
if (ret < 0) { |
670 | 670 |
monitor_resume(mon); |
671 |
qemu_free(cb_data);
|
|
671 |
g_free(cb_data);
|
|
672 | 672 |
} |
673 | 673 |
} |
674 | 674 |
|
... | ... | |
676 | 676 |
{ |
677 | 677 |
int ret; |
678 | 678 |
|
679 |
MonitorCompletionData *cb_data = qemu_malloc(sizeof(*cb_data));
|
|
679 |
MonitorCompletionData *cb_data = g_malloc(sizeof(*cb_data));
|
|
680 | 680 |
cb_data->mon = mon; |
681 | 681 |
cb_data->user_print = cmd->user_print; |
682 | 682 |
monitor_suspend(mon); |
683 | 683 |
ret = cmd->mhandler.info_async(mon, user_monitor_complete, cb_data); |
684 | 684 |
if (ret < 0) { |
685 | 685 |
monitor_resume(mon); |
686 |
qemu_free(cb_data);
|
|
686 |
g_free(cb_data);
|
|
687 | 687 |
} |
688 | 688 |
} |
689 | 689 |
|
... | ... | |
2545 | 2545 |
if (i == n) { |
2546 | 2546 |
s->ops.destroy (s->opaque); |
2547 | 2547 |
QLIST_REMOVE (s, entries); |
2548 |
qemu_free (s);
|
|
2548 |
g_free (s);
|
|
2549 | 2549 |
return; |
2550 | 2550 |
} |
2551 | 2551 |
} |
... | ... | |
2562 | 2562 |
int nchannels = qdict_get_try_int(qdict, "nchannels", -1); |
2563 | 2563 |
CaptureState *s; |
2564 | 2564 |
|
2565 |
s = qemu_mallocz (sizeof (*s));
|
|
2565 |
s = g_malloc0 (sizeof (*s));
|
|
2566 | 2566 |
|
2567 | 2567 |
freq = has_freq ? freq : 44100; |
2568 | 2568 |
bits = has_bits ? bits : 16; |
... | ... | |
2570 | 2570 |
|
2571 | 2571 |
if (wav_start_capture (s, path, freq, bits, nchannels)) { |
2572 | 2572 |
monitor_printf(mon, "Failed to add wave capture\n"); |
2573 |
qemu_free (s);
|
|
2573 |
g_free (s);
|
|
2574 | 2574 |
return; |
2575 | 2575 |
} |
2576 | 2576 |
QLIST_INSERT_HEAD (&capture_head, s, entries); |
... | ... | |
2780 | 2780 |
return 0; |
2781 | 2781 |
} |
2782 | 2782 |
|
2783 |
monfd = qemu_mallocz(sizeof(mon_fd_t));
|
|
2784 |
monfd->name = qemu_strdup(fdname);
|
|
2783 |
monfd = g_malloc0(sizeof(mon_fd_t));
|
|
2784 |
monfd->name = g_strdup(fdname);
|
|
2785 | 2785 |
monfd->fd = fd; |
2786 | 2786 |
|
2787 | 2787 |
QLIST_INSERT_HEAD(&mon->fds, monfd, next); |
... | ... | |
2800 | 2800 |
|
2801 | 2801 |
QLIST_REMOVE(monfd, next); |
2802 | 2802 |
close(monfd->fd); |
2803 |
qemu_free(monfd->name);
|
|
2804 |
qemu_free(monfd);
|
|
2803 |
g_free(monfd->name);
|
|
2804 |
g_free(monfd);
|
|
2805 | 2805 |
return 0; |
2806 | 2806 |
} |
2807 | 2807 |
|
... | ... | |
2836 | 2836 |
|
2837 | 2837 |
/* caller takes ownership of fd */ |
2838 | 2838 |
QLIST_REMOVE(monfd, next); |
2839 |
qemu_free(monfd->name);
|
|
2840 |
qemu_free(monfd);
|
|
2839 |
g_free(monfd->name);
|
|
2840 |
g_free(monfd);
|
|
2841 | 2841 |
|
2842 | 2842 |
return fd; |
2843 | 2843 |
} |
... | ... | |
4034 | 4034 |
} |
4035 | 4035 |
len = p - type; |
4036 | 4036 |
|
4037 |
str = qemu_malloc(len + 1);
|
|
4037 |
str = g_malloc(len + 1);
|
|
4038 | 4038 |
memcpy(str, type, len); |
4039 | 4039 |
str[len] = '\0'; |
4040 | 4040 |
|
... | ... | |
4417 | 4417 |
monitor_printf(mon, "%s: unknown type '%c'\n", cmdname, c); |
4418 | 4418 |
goto fail; |
4419 | 4419 |
} |
4420 |
qemu_free(key);
|
|
4420 |
g_free(key);
|
|
4421 | 4421 |
key = NULL; |
4422 | 4422 |
} |
4423 | 4423 |
/* check that all arguments were parsed */ |
... | ... | |
4432 | 4432 |
return cmd; |
4433 | 4433 |
|
4434 | 4434 |
fail: |
4435 |
qemu_free(key);
|
|
4435 |
g_free(key);
|
|
4436 | 4436 |
return NULL; |
4437 | 4437 |
} |
4438 | 4438 |
|
... | ... | |
4631 | 4631 |
if (nb_args >= MAX_ARGS) |
4632 | 4632 |
break; |
4633 | 4633 |
ret = get_str(buf, sizeof(buf), &p); |
4634 |
args[nb_args] = qemu_strdup(buf);
|
|
4634 |
args[nb_args] = g_strdup(buf);
|
|
4635 | 4635 |
nb_args++; |
4636 | 4636 |
if (ret < 0) |
4637 | 4637 |
break; |
... | ... | |
4668 | 4668 |
if (nb_args >= MAX_ARGS) { |
4669 | 4669 |
goto cleanup; |
4670 | 4670 |
} |
4671 |
args[nb_args++] = qemu_strdup("");
|
|
4671 |
args[nb_args++] = g_strdup("");
|
|
4672 | 4672 |
} |
4673 | 4673 |
if (nb_args <= 1) { |
4674 | 4674 |
/* command completion */ |
... | ... | |
4743 | 4743 |
|
4744 | 4744 |
cleanup: |
4745 | 4745 |
for (i = 0; i < nb_args; i++) { |
4746 |
qemu_free(args[i]);
|
|
4746 |
g_free(args[i]);
|
|
4747 | 4747 |
} |
4748 | 4748 |
} |
4749 | 4749 |
|
... | ... | |
5261 | 5261 |
is_first_init = 0; |
5262 | 5262 |
} |
5263 | 5263 |
|
5264 |
mon = qemu_mallocz(sizeof(*mon));
|
|
5264 |
mon = g_malloc0(sizeof(*mon));
|
|
5265 | 5265 |
|
5266 | 5266 |
mon->chr = chr; |
5267 | 5267 |
mon->flags = flags; |
... | ... | |
5271 | 5271 |
} |
5272 | 5272 |
|
5273 | 5273 |
if (monitor_ctrl_mode(mon)) { |
5274 |
mon->mc = qemu_mallocz(sizeof(MonitorControl));
|
|
5274 |
mon->mc = g_malloc0(sizeof(MonitorControl));
|
|
5275 | 5275 |
/* Control mode requires special handlers */ |
5276 | 5276 |
qemu_chr_add_handlers(chr, monitor_can_read, monitor_control_read, |
5277 | 5277 |
monitor_control_event, mon); |
Also available in: Unified diff