vnc: cleanups and fixes
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJTosMxAAoJEEy22O7T6HE436sQAMimtuVhUWMxNoyC86ucQ3Db 2hk8x7ok3kSPQwNT6EcCwgBf+aSLZPU7mc8QMNVk1VxNf2cMNeYTKWJvBLFKyz8i XvqSVSUWCLAfl3a9UN2AuKGE1GvFvmgb8pq4eSPfPBsP9CDzdzS5ftOFDpY5MMtB fX8CCCrmw+QZoVS5RLd7XTT6bkYgaQdHbZdzAODLaTl8q3whKtHwVENbxYtvYuVs i5/0IoWD3xOL91hiuyZ+ZFigSzEjUB3L0gsguzaHkz5rvSuM2yFD7UKAFurG7pQy HZ3UbzeQmge2CsAf3oSkQvZlEBNCFL8sTFElK6NLh0my3PZld8vA4D5YTFEBMi0l fp5rlEwNuIyPwOnHw2WJOG/1Op4XDM2deNxubrCRnvxeS+r48uDAUPdIhIq2+Ygs afWcC50Uu+r3q5yuqccdCUriqfE4ePq4u/+d4IlvrX6tUtZpc9LI82rLRjUkM80I MtEL1+unTFdKl5YZduGzs1NIuBDH5vjvkmtkAQ98blNNQ9c4i2nTED+SpVwqIYqw A7WQ1dC3YqP03Mf3O0ZatvA2HSvPl39LRC6peMSubqjysqBCnox9Y/U6vcY0Y0+6 uq1I3dYEHwmM0JqOPgl356s9N8hgG2lq503RIZvFQxSuE/E+PuS/8/mx/Z5hmwgV jFyILXZaUfJd46f/IVO2 =rFPx -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20140619-1' into staging vnc: cleanups and fixes # gpg: Signature made Thu 19 Jun 2014 12:02:09 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-vnc-20140619-1: vnc: fix screen updates vnc: Drop superfluous conditionals around g_strdup() vnc: Drop superfluous conditionals around g_free() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						9d3c512021
					
				| 
						 | 
				
			
			@ -443,10 +443,8 @@ static int vnc_set_x509_credential(VncDisplay *vd,
 | 
			
		|||
{
 | 
			
		||||
    struct stat sb;
 | 
			
		||||
 | 
			
		||||
    if (*cred) {
 | 
			
		||||
        g_free(*cred);
 | 
			
		||||
        *cred = NULL;
 | 
			
		||||
    }
 | 
			
		||||
    g_free(*cred);
 | 
			
		||||
    *cred = NULL;
 | 
			
		||||
 | 
			
		||||
    *cred = g_malloc(strlen(certdir) + strlen(filename) + 2);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								ui/vnc.c
								
								
								
								
							
							
						
						
									
										18
									
								
								ui/vnc.c
								
								
								
								
							| 
						 | 
				
			
			@ -935,6 +935,9 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        vnc_job_push(job);
 | 
			
		||||
        if (sync) {
 | 
			
		||||
            vnc_jobs_join(vs);
 | 
			
		||||
        }
 | 
			
		||||
        vs->force_update = 0;
 | 
			
		||||
        return n;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -2972,10 +2975,8 @@ static void vnc_display_close(DisplayState *ds)
 | 
			
		|||
 | 
			
		||||
    if (!vs)
 | 
			
		||||
        return;
 | 
			
		||||
    if (vs->display) {
 | 
			
		||||
        g_free(vs->display);
 | 
			
		||||
        vs->display = NULL;
 | 
			
		||||
    }
 | 
			
		||||
    g_free(vs->display);
 | 
			
		||||
    vs->display = NULL;
 | 
			
		||||
    if (vs->lsock != -1) {
 | 
			
		||||
        qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);
 | 
			
		||||
        close(vs->lsock);
 | 
			
		||||
| 
						 | 
				
			
			@ -3010,13 +3011,8 @@ int vnc_display_password(DisplayState *ds, const char *password)
 | 
			
		|||
        return -EINVAL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (vs->password) {
 | 
			
		||||
        g_free(vs->password);
 | 
			
		||||
        vs->password = NULL;
 | 
			
		||||
    }
 | 
			
		||||
    if (password) {
 | 
			
		||||
        vs->password = g_strdup(password);
 | 
			
		||||
    }
 | 
			
		||||
    g_free(vs->password);
 | 
			
		||||
    vs->password = g_strdup(password);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue