core: Forgot to dereference pointer when checking for NULL

Actually we already checked for !rt before, now we'd like to examine
the return value of the memory allocation.
build-sys: fix systemd-stdio-bridge link to work with split /usr

shumski> there seems to be slight error in systemd git master Makefile.am
tmpfiles: rename --unsafe to --boot

As suggested by Kay, it is better to describe what is done,
not what might happen.
bootchart: Remove unneeded check for NULL

Directly before the changed line there is:

	while ((parent->next_ps && parent->pid != ps->ppid))
		parent = parent->next_ps;

which looks one element ahead of the list, hence we can rely on parent
being non null here.
If 'parent' were NULL at that while loop already, it would crash as we're
dereferencing 'parent' when checking for next_ps already.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
sleep-config: Dereference pointer before check for NULL

This fixes a bug pointed out by http://css.csail.mit.edu/stack/
(Optimization-unstable code)
It is a similar fix as f146f5e159 (2013-12-30, core:
Forgot to dereference pointer when checking for NULL)

To explain this bug consider the following similar, but simpler code:
	if (!p)
		free(*p)

Assume the if condition evaluates to true, then we will access *p,
which means the compiler can assume p is a valid pointer, so it could
dereference p and use the value *p.
Assuming p as a valid pointer, !p will be false.
But initally we assumed the condition evaluates to true.

By this reasoning the optimizing compiler can deduce, we have dead code.
("The if will never be taken, as *p must be valid, because otherwise
accessing *p inside the if would segfault")

This led to an error message of the static code checker, so I checked the
code in question.

As we access *modes and *states before the check in the changed line of
this patch, I assume the line to be wrong and we actually wanted to check
for *modes and *states being both non null.
boot-efi: Remove superfluous assignment

2 lines after the changed line we assign err to efi_get_variable(...)
unconditionally, so it makes no sense to initialize it to some value.
sleep-config: fix double free

Before 34a3baa4d 'sleep-config: Dereference pointer before check for NULL'
oom conditions would not be detected properly. After that commit, a double
free was performed.

Rework the whole function to be easier to understand, and also replace
strv_split_nulstr with strv_new, since we know the strings anyway.
build-sys: make test-dhcp-* statically linked

This makes them behave like everything else following
48d7417d3 'build-sys: link most internal libraries statically'.
dhcp: fix creation of req_opts array

GREEDY_REALLOC needs to have two size variables: one for the
allocated size, and a second one for the used size. Using
the allocated size only lead to leaving some elements unitialized
and assigning some more than once.
build-sys: make test output a bit nicer
network: add support for dropping address
networkd: distinguish between static and dynamic addresses/routes

Static addresses/routes are associated with a network. Dynamic
addresses/routes are associtade with links (as the corresponding network
may be shared by several links).
networkd: add DHCPv4 support

This adds basic DHCPv4 support. Link-sense is enabled unconditionally,
but the plan is to make that configurable.

I tested this in a VM with lots of NICs and over wifi in the various
coffee shops I found this Christmas, but more testing would definitely
be appreciated.
networkd: fix getting initial state

We were requesting the state and then ignoring it...
networkd: fix NULL pointer deref
networkd: improve logging

Remove redundant messages, add some debugging ones and make wording more uniform.
networkd: only track state of links we are managing

If a network is not (yet) set for a link, we do not care about its state (as we
anyway don't know what to do with it).
rules: drivers - do not reset RUN list
networkd: add more asserts and ignore all events when link has failed
networkd: dhcp - avoid null pointer dereference