aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc-tls.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 /ui/vnc-tls.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 'ui/vnc-tls.c')
-rw-r--r--ui/vnc-tls.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c
index 31f1467ad0..2e2456e3ac 100644
--- a/ui/vnc-tls.c
+++ b/ui/vnc-tls.c
@@ -244,11 +244,11 @@ int vnc_tls_validate_certificate(struct VncState *vs)
if (i == 0) {
size_t dnameSize = 1024;
- vs->tls.dname = qemu_malloc(dnameSize);
+ vs->tls.dname = g_malloc(dnameSize);
requery:
if ((ret = gnutls_x509_crt_get_dn (cert, vs->tls.dname, &dnameSize)) != 0) {
if (ret == GNUTLS_E_SHORT_MEMORY_BUFFER) {
- vs->tls.dname = qemu_realloc(vs->tls.dname, dnameSize);
+ vs->tls.dname = g_realloc(vs->tls.dname, dnameSize);
goto requery;
}
gnutls_x509_crt_deinit (cert);
@@ -397,11 +397,11 @@ static int vnc_set_x509_credential(VncDisplay *vd,
struct stat sb;
if (*cred) {
- qemu_free(*cred);
+ g_free(*cred);
*cred = NULL;
}
- *cred = qemu_malloc(strlen(certdir) + strlen(filename) + 2);
+ *cred = g_malloc(strlen(certdir) + strlen(filename) + 2);
strcpy(*cred, certdir);
strcat(*cred, "/");
@@ -409,7 +409,7 @@ static int vnc_set_x509_credential(VncDisplay *vd,
VNC_DEBUG("Check %s\n", *cred);
if (stat(*cred, &sb) < 0) {
- qemu_free(*cred);
+ g_free(*cred);
*cred = NULL;
if (ignoreMissing && errno == ENOENT)
return 0;
@@ -435,10 +435,10 @@ int vnc_tls_set_x509_creds_dir(VncDisplay *vd,
return 0;
cleanup:
- qemu_free(vd->tls.x509cacert);
- qemu_free(vd->tls.x509cacrl);
- qemu_free(vd->tls.x509cert);
- qemu_free(vd->tls.x509key);
+ g_free(vd->tls.x509cacert);
+ g_free(vd->tls.x509cacrl);
+ g_free(vd->tls.x509cert);
+ g_free(vd->tls.x509key);
vd->tls.x509cacert = vd->tls.x509cacrl = vd->tls.x509cert = vd->tls.x509key = NULL;
return -1;
}