]> git.proxmox.com Git - qemu.git/commitdiff
spice: Fix unchecked strdup() by converting to g_strdup()
authorMarkus Armbruster <armbru@redhat.com>
Tue, 22 Jan 2013 10:08:00 +0000 (11:08 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 30 Jan 2013 10:14:46 +0000 (11:14 +0100)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ui/spice-core.c

index 3f2c5650cd8e18a708aa4fd689a1edcb3a6bc9cc..bcc4199e7ac3eddfbee106aec97b83f6cf5ce3b9 100644 (file)
@@ -848,8 +848,8 @@ static int qemu_spice_set_ticket(bool fail_if_conn, bool disconnect_if_conn)
 int qemu_spice_set_passwd(const char *passwd,
                           bool fail_if_conn, bool disconnect_if_conn)
 {
-    free(auth_passwd);
-    auth_passwd = strdup(passwd);
+    g_free(auth_passwd);
+    auth_passwd = g_strdup(passwd);
     return qemu_spice_set_ticket(fail_if_conn, disconnect_if_conn);
 }