Use g_steal_pointer where possible

Via coccinelle (not the handbag!)
spatches used:
@ rule1 @
identifier a, b;
symbol NULL;
@@

- b = a;
  ... when != a
- a = NULL;
+ b = g_steal_pointer(&a);

@@

- *b = a;
  ... when != a
- a = NULL;
+ *b = g_steal_pointer(&a);

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Kristina Hanicova
2021-02-23 14:58:29 +01:00
committed by Ján Tomko
parent cb29e4e801
commit 155151a3d0
21 changed files with 45 additions and 90 deletions

View File

@@ -116,8 +116,7 @@ static struct Arguments *parseArguments(int argc, char** argv)
}
}
ret = args;
args = NULL;
ret = g_steal_pointer(&args);
return ret;
}