mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-13 13:17:43 +03:00
rfkill: use our usual style for writing destructors
Let's accept NULL values gracefully, and let's return NULL.
This commit is contained in:
parent
6064de2de8
commit
3b3d1737be
@ -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] = {
|
||||
|
Loading…
Reference in New Issue
Block a user