aboutsummaryrefslogtreecommitdiff
path: root/audio/wavcapture.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /audio/wavcapture.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'audio/wavcapture.c')
-rw-r--r--audio/wavcapture.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index 1f49cd1fec..c64f0ef075 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -48,7 +48,7 @@ static void wav_destroy (void *opaque)
qemu_fclose (wav->f);
}
- qemu_free (wav->path);
+ g_free (wav->path);
}
static void wav_capture (void *opaque, void *buf, int size)
@@ -120,7 +120,7 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
ops.capture = wav_capture;
ops.destroy = wav_destroy;
- wav = qemu_mallocz (sizeof (*wav));
+ wav = g_malloc0 (sizeof (*wav));
shift = bits16 + stereo;
hdr[34] = bits16 ? 0x10 : 0x08;
@@ -134,11 +134,11 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
if (!wav->f) {
monitor_printf(mon, "Failed to open wave file `%s'\nReason: %s\n",
path, strerror (errno));
- qemu_free (wav);
+ g_free (wav);
return -1;
}
- wav->path = qemu_strdup (path);
+ wav->path = g_strdup (path);
wav->bits = bits;
wav->nchannels = nchannels;
wav->freq = freq;
@@ -148,9 +148,9 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
cap = AUD_add_capture (&as, &ops, wav);
if (!cap) {
monitor_printf(mon, "Failed to add audio capture\n");
- qemu_free (wav->path);
+ g_free (wav->path);
qemu_fclose (wav->f);
- qemu_free (wav);
+ g_free (wav);
return -1;
}