From: Lennart Poettering Date: Thu, 5 Apr 2018 10:42:47 +0000 (+0200) Subject: rfkill: use our usual style for writing destructors X-Git-Tag: v239~434^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b3d1737be0023791e45dfa357b347c832d2a615;p=thirdparty%2Fsystemd.git rfkill: use our usual style for writing destructors Let's accept NULL values gracefully, and let's return NULL. --- diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index bae3aec1757..139b4343b00 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] = {