qemu-log: Fix unchecked strdup() by converting to g_strdup()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
		
							parent
							
								
									606017de2f
								
							
						
					
					
						commit
						636e0f27c6
					
				| 
						 | 
					@ -84,7 +84,7 @@ void qemu_set_log(int log_flags, bool use_own_buffers)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void cpu_set_log_filename(const char *filename)
 | 
					void cpu_set_log_filename(const char *filename)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    logfilename = strdup(filename);
 | 
					    logfilename = g_strdup(filename);
 | 
				
			||||||
    if (qemu_logfile) {
 | 
					    if (qemu_logfile) {
 | 
				
			||||||
        fclose(qemu_logfile);
 | 
					        fclose(qemu_logfile);
 | 
				
			||||||
        qemu_logfile = NULL;
 | 
					        qemu_logfile = NULL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue