tree-wide: use free_and_strdup()

Use free_and_strdup() where appropriate and replace equivalent,
open-coded versions.
This commit is contained in:
Daniel Mack
2015-07-30 13:09:01 +02:00
parent 5f17089ac1
commit 2fc09a9cdd
10 changed files with 40 additions and 59 deletions
+2 -6
View File
@@ -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;