mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
maint: avoid useless "if (foo) free(foo)" pattern
My Coccinelle semantic patch finds a few more, because it also fixes up the equally pointless conditional if (foo) { free(foo); foo = NULL; } Result (feel free to squash it into your patch): Signed-off-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
ef1e1e0782
commit
012aef0734
9 changed files with 20 additions and 40 deletions
|
@ -234,10 +234,8 @@ static int fifo_empty_elements_number(Exynos4210UartFIFO *q)
|
|||
|
||||
static void fifo_reset(Exynos4210UartFIFO *q)
|
||||
{
|
||||
if (q->data != NULL) {
|
||||
g_free(q->data);
|
||||
q->data = NULL;
|
||||
}
|
||||
g_free(q->data);
|
||||
q->data = NULL;
|
||||
|
||||
q->data = (uint8_t *)g_malloc0(q->size);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue