diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-04-05 12:42:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-04-05 12:42:50 +0200 |
commit | 3b3d1737be0023791e45dfa357b347c832d2a615 (patch) | |
tree | 2cb52fae4115fb8fd851379bcf5924413b7cb318 /src/rfkill | |
parent | Merge pull request #8617 from keszybz/tmpfiles-relax (diff) | |
download | systemd-3b3d1737be0023791e45dfa357b347c832d2a615.tar.xz systemd-3b3d1737be0023791e45dfa357b347c832d2a615.zip |
rfkill: use our usual style for writing destructors
Let's accept NULL values gracefully, and let's return NULL.
Diffstat (limited to '')
-rw-r--r-- | src/rfkill/rfkill.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index bae3aec175..139b4343b0 100644 --- a/src/rfkill/rfkill.c +++ b/src/rfkill/rfkill.c @@ -49,12 +49,12 @@ typedef struct write_queue_item { int state; } write_queue_item; -static void write_queue_item_free(struct write_queue_item *item) -{ - assert(item); +static struct write_queue_item* write_queue_item_free(struct write_queue_item *item) { + if (!item) + return NULL; free(item->file); - free(item); + return mfree(item); } static const char* const rfkill_type_table[NUM_RFKILL_TYPES] = { |