summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/install-printf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c
index 823fb61cda..c10ed3d311 100644
--- a/src/shared/install-printf.c
+++ b/src/shared/install-printf.c
@@ -93,9 +93,9 @@ static int specifier_instance(char specifier, void *data, void *userdata, char *
return r;
if (isempty(instance)) {
- instance = strdup(i->default_instance ?: "");
- if (!instance)
- return -ENOMEM;
+ r = free_and_strdup(&instance, i->default_instance ?: "");
+ if (r < 0)
+ return r;
}
*ret = instance;