]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #976 from elfring/Remove_unnecessary_checks2
authorLennart Poettering <lennart@poettering.net>
Mon, 17 Aug 2015 09:30:31 +0000 (11:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Aug 2015 09:30:31 +0000 (11:30 +0200)
Delete unnecessary checks before some function calls

1  2 
src/libsystemd/sd-bus/bus-message.c

index b52285403f68339c95d6160f60bc59c57707d392,7714baf045055b69fd3b22a9fdd049506d8812b7..a212f0b398bd9de9e581ea73e1ae094ef61f7b84
@@@ -143,11 -143,7 +143,7 @@@ static void message_free(sd_bus_messag
          if (m->iovec != m->iovec_fixed)
                  free(m->iovec);
  
-         if (m->destination_ptr) {
-                 free(m->destination_ptr);
-                 m->destination_ptr = NULL;
-         }
+         m->destination_ptr = mfree(m->destination_ptr);
          message_reset_containers(m);
          free(m->root_container.signature);
          free(m->root_container.offsets);
@@@ -2686,7 -2682,7 +2682,7 @@@ _public_ int sd_bus_message_append_arra
          int r;
  
          assert_return(m, -EINVAL);
 -        assert_return(memfd >= 0, -EINVAL);
 +        assert_return(memfd >= 0, -EBADF);
          assert_return(bus_type_is_trivial(type), -EINVAL);
          assert_return(size > 0, -EINVAL);
          assert_return(!m->sealed, -EPERM);
@@@ -2762,7 -2758,7 +2758,7 @@@ _public_ int sd_bus_message_append_stri
          int r;
  
          assert_return(m, -EINVAL);
 -        assert_return(memfd >= 0, -EINVAL);
 +        assert_return(memfd >= 0, -EBADF);
          assert_return(size > 0, -EINVAL);
          assert_return(!m->sealed, -EPERM);
          assert_return(!m->poisoned, -ESTALE);