]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
condition: return (Condition*) NULL from condition_free()
authorLennart Poettering <lennart@poettering.net>
Thu, 14 May 2020 16:43:46 +0000 (18:43 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 May 2020 13:50:09 +0000 (15:50 +0200)
Follow our usual coding style.

src/shared/condition.c
src/shared/condition.h

index fef37057db9dadbd4bdd77e041e61e2759ce1ce2..3c76c86a0fd22555aa6fb69c8e536ac6f210c1f9 100644 (file)
@@ -73,11 +73,11 @@ Condition* condition_new(ConditionType type, const char *parameter, bool trigger
         return c;
 }
 
-void condition_free(Condition *c) {
+Condition* condition_free(Condition *c) {
         assert(c);
 
         free(c->parameter);
-        free(c);
+        return mfree(c);
 }
 
 Condition* condition_free_list_type(Condition *head, ConditionType type) {
index fa00f6ea983674721cabb80884c6500eac892b27..11dfc7425b810af9f71b969ce5000e99eed2afea 100644 (file)
@@ -67,7 +67,7 @@ typedef struct Condition {
 } Condition;
 
 Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate);
-void condition_free(Condition *c);
+Condition* condition_free(Condition *c);
 Condition* condition_free_list_type(Condition *first, ConditionType type);
 static inline Condition* condition_free_list(Condition *first) {
         return condition_free_list_type(first, _CONDITION_TYPE_INVALID);