summaryrefslogtreecommitdiff
path: root/src/rfkill
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-05 12:42:47 +0200
committerLennart Poettering <lennart@poettering.net>2018-04-05 12:42:50 +0200
commit3b3d1737be0023791e45dfa357b347c832d2a615 (patch)
tree2cb52fae4115fb8fd851379bcf5924413b7cb318 /src/rfkill
parent6064de2de8734401669b787b68ebbf858d452cec (diff)
downloadsystemd-3b3d1737be0023791e45dfa357b347c832d2a615.tar.gz
rfkill: use our usual style for writing destructors
Let's accept NULL values gracefully, and let's return NULL.
Diffstat (limited to 'src/rfkill')
-rw-r--r--src/rfkill/rfkill.c8
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] = {