From 2734bc17de6bf58a1e9bbcec0a6c98f77dc2cf6c Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Mon, 6 Mar 2023 23:41:40 +0300 Subject: [PATCH] libratbag-util: make dpi_list_free() be able to take NULL free() can take NULL without errors, and so should such helper. --- src/libratbag-util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libratbag-util.h b/src/libratbag-util.h index ed431d8e..9c9829be 100644 --- a/src/libratbag-util.h +++ b/src/libratbag-util.h @@ -264,6 +264,8 @@ struct dpi_list { static inline void dpi_list_free(struct dpi_list *list) { + if (list == NULL) + return; free(list->entries); free(list); }