diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-04-03 01:46:54 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 01:46:54 +0900 |
commit | 33ca308f388724da9f64aa2a8ca07e2f7bbe4b90 (patch) | |
tree | e4c6976dd558a9b5fa699ba927dd0432b10ef42e /src/boot/efi/boot.c | |
parent | 82c604607f30f6ab6bf9e55e88b41e5579983520 (diff) | |
parent | 568ee8fc468d139b87ce771098b11aa15086c30f (diff) | |
download | systemd-33ca308f388724da9f64aa2a8ca07e2f7bbe4b90.tar.gz |
Merge pull request #12188 from poettering/coccinelle-fixlets
tree-wide: let's run coccinelle again
Diffstat (limited to 'src/boot/efi/boot.c')
-rw-r--r-- | src/boot/efi/boot.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 7b3e782454..57c423bfb6 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -269,10 +269,8 @@ static BOOLEAN line_edit( case KEYPRESS(0, 0, CHAR_LINEFEED): case KEYPRESS(0, 0, CHAR_CARRIAGE_RETURN): - if (StrCmp(line, line_in) != 0) { - *line_out = line; - line = NULL; - } + if (StrCmp(line, line_in) != 0) + *line_out = TAKE_PTR(line); enter = TRUE; exit = TRUE; break; @@ -1258,8 +1256,7 @@ static VOID config_entry_bump_counters( /* If the file we just renamed is the loader path, then let's update that. */ if (StrCmp(entry->loader, old_path) == 0) { FreePool(entry->loader); - entry->loader = new_path; - new_path = NULL; + entry->loader = TAKE_PTR(new_path); } } @@ -1360,10 +1357,8 @@ static VOID config_entry_add_from_file( s = PoolPrint(L"%s %s", entry->options, new); FreePool(entry->options); entry->options = s; - } else { - entry->options = new; - new = NULL; - } + } else + entry->options = TAKE_PTR(new); continue; } @@ -1382,10 +1377,8 @@ static VOID config_entry_add_from_file( s = PoolPrint(L"%s %s", initrd, entry->options); FreePool(entry->options); entry->options = s; - } else { - entry->options = initrd; - initrd = NULL; - } + } else + entry->options = TAKE_PTR(initrd); } entry->device = device; |