mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
lib: Use g_clear_pointer() more
This change was generated using the following spatch:
@ rule1 @
expression a;
identifier f;
@@
<...
- f(*a);
... when != a;
- *a = NULL;
+ g_clear_pointer(a, f);
...>
@ rule2 @
expression a;
identifier f;
@@
<...
- f(a);
... when != a;
- a = NULL;
+ g_clear_pointer(&a, f);
...>
Then, I left some of the changes out, like tools/nss/ (which
doesn't link with glib) and put back a comment in
qemuBlockJobProcessEventCompletedActiveCommit() which coccinelle
decided to remove (I have no idea why).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
1 parent
1688d2527f
commit
87a43a907f
100 files changed
+252
-501
No files matched your search
+2
-4
@@ -446,8 +446,7 @@ static int test13(const void *unused G_GNUC_UNUSED)
|
||||
if (!outactual)
|
||||
goto cleanup;
|
||||
|
||||
virCommandFree(cmd);
|
||||
cmd = NULL;
|
||||
g_clear_pointer(&cmd, virCommandFree);
|
||||
|
||||
if (STRNEQ(outactual, outexpect)) {
|
||||
virTestDifference(stderr, outexpect, outactual);
|
||||
@@ -668,8 +667,7 @@ static int test18(const void *unused G_GNUC_UNUSED)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virCommandFree(cmd);
|
||||
cmd = NULL;
|
||||
g_clear_pointer(&cmd, virCommandFree);
|
||||
if (kill(pid, 0) != 0) {
|
||||
printf("daemon should still be running\n");
|
||||
goto cleanup;
|
||||
|
||||
Reference in new issue
Block a user