tree-wide: use free_and_strdup()
Use free_and_strdup() where appropriate and replace equivalent, open-coded versions.
This commit is contained in:
+2
-6
@@ -1129,13 +1129,9 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
if (arg_unit && isempty(description)) {
|
||||
free(description);
|
||||
description = strdup(arg_unit);
|
||||
|
||||
if (!description) {
|
||||
r = log_oom();
|
||||
r = free_and_strdup(&description, arg_unit);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
arg_description = description;
|
||||
|
||||
Reference in New Issue
Block a user