mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
maint: avoid useless "if (foo) free(foo)" pattern
The free() and g_free() functions both happily accept NULL on any platform QEMU builds on. As such putting a conditional 'if (foo)' check before calls to 'free(foo)' merely serves to bloat the lines of code. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
4595a48a10
commit
ef1e1e0782
20 changed files with 39 additions and 93 deletions
|
@ -187,9 +187,7 @@ static void fw_cfg_bootsplash(FWCfgState *s)
|
|||
g_free(filename);
|
||||
return;
|
||||
}
|
||||
if (boot_splash_filedata != NULL) {
|
||||
g_free(boot_splash_filedata);
|
||||
}
|
||||
g_free(boot_splash_filedata);
|
||||
boot_splash_filedata = (uint8_t *)file_data;
|
||||
boot_splash_filedata_size = file_size;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue