tree-wide: make condition_free_list return NULL

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-12-18 19:26:21 -05:00
parent f1acf85a36
commit 447021aafd
3 changed files with 7 additions and 8 deletions
+3 -6
View File
@@ -2042,8 +2042,7 @@ int config_parse_unit_condition_path(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
condition_free_list(*list);
*list = NULL;
*list = condition_free_list(*list);
return 0;
}
@@ -2100,8 +2099,7 @@ int config_parse_unit_condition_string(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
condition_free_list(*list);
*list = NULL;
*list = condition_free_list(*list);
return 0;
}
@@ -2150,8 +2148,7 @@ int config_parse_unit_condition_null(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
condition_free_list(*list);
*list = NULL;
*list = condition_free_list(*list);
return 0;
}
+3 -1
View File
@@ -73,11 +73,13 @@ void condition_free(Condition *c) {
free(c);
}
void condition_free_list(Condition *first) {
Condition* condition_free_list(Condition *first) {
Condition *c, *n;
LIST_FOREACH_SAFE(conditions, c, n, first)
condition_free(c);
return NULL;
}
static int condition_test_kernel_command_line(Condition *c) {
+1 -1
View File
@@ -79,7 +79,7 @@ typedef struct Condition {
Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate);
void condition_free(Condition *c);
void condition_free_list(Condition *c);
Condition* condition_free_list(Condition *c);
int condition_test(Condition *c);