From 2fc09a9cdd1ad25bc7c53a23d5301eb952e1ce3d Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 29 Jul 2015 20:25:57 +0200 Subject: tree-wide: use free_and_strdup() Use free_and_strdup() where appropriate and replace equivalent, open-coded versions. --- src/run/run.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/run/run.c') diff --git a/src/run/run.c b/src/run/run.c index 148854a9b5..3dd97022de 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -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; -- cgit v1.2.3-54-g00ecf