#31 files.c: Init char *name to NULL
Merged by jhrozek. Opened by jhrozek.
jhrozek/libuser init_name_to_null  into  master

Download 31.patch

This is mostly to silence coverity warnings. "enum lu_entity_type" has
three values and several places in the code follow logic as:

char *name;
if ent->type == user:
name = foo()
if ent->type == group
name = bar()
g_assert(name != NULL)

it shouldn't be possible for ent->type to be anything else but in the
odd case it is, initializing name to NULL will ensure that name will be
still NULL after the code falls through the conditions and at least the
behaviour is defined.

rebased onto 7acf0fad0ca468f33f86084f36251df5baf3dc94

Commit 38021b6a fixes this pull-request

Pull-Request has been merged by jhrozek

Pull-Request has been merged by jhrozek

Metadata