From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMid-0005bF-J3 for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLMia-0000if-1J for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:22:07 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:50054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMiZ-0000iP-Sb for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:22:03 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Nov 2011 18:22:01 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA1MKvkc279792 for ; Tue, 1 Nov 2011 18:20:57 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA1MKv44003630 for ; Tue, 1 Nov 2011 16:20:57 -0600 Message-ID: <4EB070C8.9010309@us.ibm.com> Date: Tue, 01 Nov 2011 17:20:56 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1318014920-6100-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1318014920-6100-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ui/vnc: Fix use of free() instead of g_free() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-devel@nongnu.org On 10/07/2011 02:15 PM, Stefan Weil wrote: > Please note that mechlist still uses malloc / strdup / free. > > Signed-off-by: Stefan Weil --- > ui/vnc-auth-sasl.c | 8 ++++---- > ui/vnc-enc-hextile.c | 4 ++-- > ui/vnc-tls.c | 2 +- > ui/vnc.c | 8 ++++---- > 4 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c > index e96095a..23b1bf5 100644 > --- a/ui/vnc-auth-sasl.c > +++ b/ui/vnc-auth-sasl.c > @@ -34,7 +34,7 @@ void vnc_sasl_client_cleanup(VncState *vs) > vs->sasl.runSSF = vs->sasl.waitWriteSSF = vs->sasl.wantSSF = 0; > vs->sasl.encodedLength = vs->sasl.encodedOffset = 0; > vs->sasl.encoded = NULL; > - free(vs->sasl.username); > + g_free(vs->sasl.username); > free(vs->sasl.mechlist); > vs->sasl.username = vs->sasl.mechlist = NULL; > sasl_dispose(&vs->sasl.conn); > @@ -506,7 +506,7 @@ void start_auth_sasl(VncState *vs) > goto authabort; > > if (!(remoteAddr = vnc_socket_remote_addr("%s;%s", vs->csock))) { > - free(localAddr); > + g_free(localAddr); > goto authabort; > } > > @@ -518,8 +518,8 @@ void start_auth_sasl(VncState *vs) > NULL, /* Callbacks, not needed */ > SASL_SUCCESS_DATA, > &vs->sasl.conn); > - free(localAddr); > - free(remoteAddr); > + g_free(localAddr); > + g_free(remoteAddr); > localAddr = remoteAddr = NULL; > > if (err != SASL_OK) { > diff --git a/ui/vnc-enc-hextile.c b/ui/vnc-enc-hextile.c > index d2905c8..c860dbb 100644 > --- a/ui/vnc-enc-hextile.c > +++ b/ui/vnc-enc-hextile.c > @@ -80,8 +80,8 @@ int vnc_hextile_send_framebuffer_update(VncState *vs, int x, > last_bg, last_fg,&has_bg,&has_fg); > } > } > - free(last_fg); > - free(last_bg); > + g_free(last_fg); > + g_free(last_bg); > > return 1; > } > diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c > index ffbd172..3aaa939 100644 > --- a/ui/vnc-tls.c > +++ b/ui/vnc-tls.c > @@ -413,7 +413,7 @@ void vnc_tls_client_cleanup(struct VncState *vs) > vs->tls.session = NULL; > } > vs->tls.wiremode = VNC_WIREMODE_CLEAR; > - free(vs->tls.dname); > + g_free(vs->tls.dname); > } > > > diff --git a/ui/vnc.c b/ui/vnc.c > index fc3a612..3107918 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -2880,7 +2880,7 @@ int vnc_display_open(DisplayState *ds, const char *display) > if ((saslErr = sasl_server_init(NULL, "qemu")) != SASL_OK) { > fprintf(stderr, "Failed to initialize SASL auth %s", > sasl_errstring(saslErr, NULL, NULL)); > - free(vs->display); > + g_free(vs->display); > vs->display = NULL; > return -1; > } > @@ -2894,7 +2894,7 @@ int vnc_display_open(DisplayState *ds, const char *display) > else > vs->lsock = inet_connect(display, SOCK_STREAM); > if (-1 == vs->lsock) { > - free(vs->display); > + g_free(vs->display); > vs->display = NULL; > return -1; > } else { > @@ -2915,10 +2915,10 @@ int vnc_display_open(DisplayState *ds, const char *display) > vs->lsock = inet_listen(display, dpy, 256, SOCK_STREAM, 5900); > } > if (-1 == vs->lsock) { > - free(dpy); > + g_free(dpy); > return -1; > } else { > - free(vs->display); > + g_free(vs->display); > vs->display = dpy; > } > }