chiark / gitweb /
Replace free and reassignment with free_and_replace
authorDaniel Lockyer <thisisdaniellockyer@gmail.com>
Fri, 24 Nov 2017 10:33:41 +0000 (10:33 +0000)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Nov 2017 10:33:41 +0000 (10:33 +0000)
src/libelogind/sd-bus/sd-bus.c

index b180fab3383462cf3dbd7df4f4fc07648b5fec92..c305e8c37d09d22e9cbf0727067b68e8723663b9 100644 (file)
@@ -790,9 +790,7 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid)
                 if (!machine_name_is_valid(machine))
                         return -EINVAL;
 
-                free(b->machine);
-                b->machine = machine;
-                machine = NULL;
+                free_and_replace(b->machine, machine);
         } else {
                 b->machine = mfree(b->machine);
         }